add protection against creating an action/store with no name

This commit is contained in:
Yonatan Schreiber
2015-04-15 00:18:24 +03:00
parent 80ddea2248
commit 7242c7030f
4 changed files with 13 additions and 6 deletions
+6 -3
View File
@@ -3,9 +3,12 @@ var util = require('util');
var ScriptBase = require('../script-base.js');
var StoreGenerator = module.exports = function StoreGenerator(args, options, config) {
args[0] += 'Store';
ScriptBase.apply(this, arguments);
}
if (!args[0]) console.log('\n Please specify a name for this store \n');
else {
args[0] += 'Store';
ScriptBase.apply(this, arguments)
}
};
util.inherits(StoreGenerator, ScriptBase);