1
0
Fork 0

cli - cache quick bugfix

master
Ruben Meyer 3 years ago
parent c85b0deea7
commit 222224ee4c
  1. 18
      bin/cli/cmds/cache_handler.js

@ -22,24 +22,24 @@ module.exports = {
vorpal.exec('cache --help');
}
else if(action == 'flush') {
if(typeof global['app'].cache[type] !== "undefined") {
global['app'].cache[type] = {};
if(typeof global['gds'].cache[type] !== "undefined") {
global['gds'].cache[type] = {};
console.log(type+' cache flush');
} else if(type == 'all') {
global['app'].cache = {};
global['gds'].cache = {};
console.log('full cache flush');
}
else vorpal.exec('cache --help');
}
else if(action == 'get') {
console.log(Object.keys(global['app'].cache));
console.log(Object.keys(global['gds'].cache));
console.log(type);
console.log(type in Object.keys(global['app'].cache));
console.log(Object.keys(global['app'].cache).hasOwnProperty(type));
if(typeof global['app'].cache[type] !== "undefined") {
console.log(JSON.stringify(global['app'].cache[type]));
console.log(type in Object.keys(global['gds'].cache));
console.log(Object.keys(global['gds'].cache).hasOwnProperty(type));
if(typeof global['gds'].cache[type] !== "undefined") {
console.log(JSON.stringify(global['gds'].cache[type]));
} else if(type == 'all'){
console.log(JSON.stringify(global['app'].cache));
console.log(JSON.stringify(global['gds'].cache));
} else {
console.log("The cache \""+type+"\" doesnt exists.");
vorpal.exec('cache --help');

Loading…
Cancel
Save