Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
//
var target;
var output = [];
switch (topic)
{
case 'app':
case 'module':
target = topic == 'app' ? options.output : path.join(options.output, options.name);
resolveDirPath(target);
output = [target];
// if folder exists and not empty - confirm possible file rewrite
if (fs.readdirSync(target).length)
clap.confirm('Destination folder is not empty, some files may be overwritten. Continue? (y/n) ', function(yes){
if (yes)
{
console.log();
mainTask();
}
});
else
mainTask();
break;
case 'type':
options.instanceName = options.name.charAt(0).toLowerCase() + options.name.substr(1);
target = options.output;
output = [target];