1
0
Fork 0

cli - cache quick bugfix

This commit is contained in:
Ruben Meyer 2019-09-01 21:30:16 +02:00
parent c85b0deea7
commit 222224ee4c
1 changed files with 9 additions and 9 deletions

View File

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