Skip to content

Commit

Permalink
Improve sails --help output re: #3539 (note that this removes support…
Browse files Browse the repository at this point in the history
… for common mispellings)
  • Loading branch information
mikermcneil committed Feb 3, 2016
1 parent 62ae56f commit da59607
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
18 changes: 9 additions & 9 deletions bin/sails-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ module.exports = function() {

// If no module path was specified, bail out
if (!modulePath) {
console.error("No module specified for the `deploy` command.");
console.error("To use `sails deploy`, set a `commands.deploy.module` setting in your .sailsrc file");
console.error('No module specified for the `deploy` command.');
console.error('To use `sails deploy`, set a `commands.deploy.module` setting in your .sailsrc file');
return;
}

Expand All @@ -39,27 +39,27 @@ module.exports = function() {

// If the module couldn't be required, bail out
catch (e) {
console.error("Could not require module at path: " + modulePath + ". Please check the path and try again.");
console.error('Could not require module at path: ' + modulePath + '. Please check the path and try again.');
}

try {
// Attempt to run the deploy command
module({config: rconf}, function(err, result) {
// If there were any issues, log them to the console.
if (err) {
console.error("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
console.error("Deployed failed! Details below:");
console.error("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
console.error('Deployment failed! Details below:');
console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
console.error(err);
}
});
}
// Chances are we won't catch any errors internal to the deploy command here;
// this would probably be an error at the top level of the deploy script.
catch(e) {
console.error("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
console.error("Could not run deploy! Details below:");
console.error("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
console.error('Could not run deploy! Details below:');
console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
console.error(e);
}

Expand Down
15 changes: 1 addition & 14 deletions bin/sails.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,7 @@ cmd.action(require('./sails-deploy'));
cmd = program.command('console');
cmd.unknownOption = NOOP;
cmd.description('');
cmd.action(require('./sails-console'));

// some quick aliases (TODO do something more intelligent when we get around to upgrading commander)
cmd = program.command('consle');
cmd.unknownOption = NOOP;
cmd.description('');
cmd.action(require('./sails-console'));
cmd = program.command('consloe');
cmd.unknownOption = NOOP;
cmd.description('');
cmd.action(require('./sails-console'));
cmd = program.command('c');
cmd.unknownOption = NOOP;
cmd.description('');
cmd.alias('c');
cmd.action(require('./sails-console'));


Expand Down

0 comments on commit da59607

Please sign in to comment.