scripts/generator.js
function deleteCommandOnCmdEditor (config) {

	var commands = config.commands || {};
	var command_names = Object.keys(commands);
	command_names.unshift('<< Cancel');

	var promise = inquirer.prompt([{
		type: 'list',
		name: 'cmdName',
		message: 'Choose the command you want to delete',
		choices: command_names
	}]);

	return promise.then(function (answer) {

		if (answer.cmdName == '<< Cancel') {
			return false;
		}

		delete config.commands[answer.cmdName];

		// Done
		console.log(colors.bold.green('\n\nThis command has been deleted: ' + answer.cmdName));

		// Save to the commands file
		console.log('\nWriting to ' + process.cwd() + '/' + COMMANDS_FILENAME);
		fs.writeFileSync(COMMANDS_FILENAME, JSON.stringify(config.commands));
		console.log('Writing has been completed.\n\n');

		return true;

	});

}
function deleteCommandOnCmdEditor (config) {

	var commands = config.commands || {};
	var command_names = Object.keys(commands);
	command_names.unshift('<< Cancel');

	var promise = inquirer.prompt([{
		type: 'list',
		name: 'cmdName',
		message: 'Choose the command you want to delete',
		choices: command_names
	}]);

	return promise.then(function (answer) {

		if (answer.cmdName == '<< Cancel') {
			return false;
		}

		delete config.commands[answer.cmdName];

		// Done
		console.log(colors.bold.green('\n\nThis command has been deleted: ' + answer.cmdName));

		// Save to the commands file
		console.log('\nWriting to ' + process.cwd() + '/' + COMMANDS_FILENAME);
		fs.writeFileSync(COMMANDS_FILENAME, JSON.stringify(config.commands));
		console.log('Writing has been completed.\n\n');

		return true;

	});

}
function deleteCommandOnCmdEditor ( config ) { var commands = config . commands || { } ; var command_names = Object . keys ( commands ) ; command_names . unshift ( '<< Cancel' ) ; var promise = inquirer . prompt ( [ { type : 'list' , name : 'cmdName' , message : 'Choose the command you want to delete' , choices : command_names } ] ) ; return promise . then ( function ( answer ) { if ( answer . cmdName == '<< Cancel' ) { return false ; } delete config . commands [ answer . cmdName ] ; // Done console . log ( colors . bold . green ( '\n\nThis command has been deleted: ' + answer . cmdName ) ) ; // Save to the commands file console . log ( '\nWriting to ' + process . cwd ( ) + '/' + COMMANDS_FILENAME ) ; fs . writeFileSync ( COMMANDS_FILENAME , JSON . stringify ( config . commands ) ) ; console . log ( 'Writing has been completed.\n\n' ) ; return true ; } ) ; }
Command Editor - Delete a command
@param  {Object} config             Current configuration
@return {Promise}
Command Editor - Delete a command