module.exports.config = function(field, value){ info[field] = value; gu.fse.writeJsonSync(configPath, info, { throws: false }); gu.close('Config Successfully saved.'); }
var gu = require(__dirname+'/gu.js'); var cmd = require('node-cmd'); var info = {}; var configPath = __dirname+'/../config.json'; if (gu.fs.existsSync(configPath)) { info = gu.fse.readJsonSync(configPath, { throws: false }); } /* waw add */ var getAddOption = function(callback){ rl.question('What do you want to add into your waw project?\n1) Part\n2) Routing Page\n3) Local Page\n4) Simple Page\nChoose: ', function(answer){ answer = answer.toLowerCase(); if(answer=='1'||answer=='2'||answer=='3'||answer=='public page'|| answer=='p'||answer=='pp'||answer=='lp'|| answer=='part'||answer=='local page') callback(answer); else{ console.log('Please select one of the options'); getAddOption(obj, callback); } }); } var createPart = function(){ rl.question('Give name for new part: ', function(name) { if(!name){ console.log('Empty name is not allowed.'); createPart(); } if(name.indexOf('@')>-1)