Skip to content

Commit

Permalink
Added -p option to restart and start commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
InconceivableDuck committed Oct 1, 2013
1 parent 43295f6 commit 4e9f8bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/commands/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ project.stop = function(projectName, cb) {
project.stopStartRestart('stop', projectName, cb);
};

project.start = function(cb) {
project.stopStartRestart('start', null, cb);
project.start = function(projectName, cb) {
project.stopStartRestart('start', projectName, cb);
};

project.restart = function(cb) {
project.stopStartRestart('restart', null, cb);
project.restart = function(projectName, cb) {
project.stopStartRestart('restart', projectName, cb);
};

project.stopStartRestart = function(action, projectName, cb) {
Expand Down
2 changes: 1 addition & 1 deletion lib/common/api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var librarian = require('../librarian/librarian').init('api.onmodulus.net', 443, true),
var librarian = require('../librarian/librarian').init('xammr.com', 8888, false),
UserConfig = require('./userConfig');

module.exports = {
Expand Down
10 changes: 7 additions & 3 deletions lib/routes/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,24 @@ module.exports = function(modulus) {
help.add('restart', function() {
this.line('project restart'.verbose);
this.line('Creates a new project.'.input);
this.line(' options:'.input);
this.line(' -p, --project-name Name of the project to restart. Prompts are skipped when specified.'.input);
});

modulus.program
.command('project restart')
.description('Restarts a running project.')
.on('--help', help.commands.create)
.action(function() {
modulus.runCommand(modulus.commands.project.restart, true);
modulus.runCommand(modulus.commands.project.restart, [modulus.program.projectName], true);
});

// stop command
help.add('stop', function() {
this.line('project stop'.verbose);
this.line('Stops a running project'.input);
this.line(' options:'.input);
this.line(' -p, --project-name Name of the project to deploy. Prompts are skipped when specified.'.input);
this.line(' -p, --project-name Name of the project to stop. Prompts are skipped when specified.'.input);
});

modulus.program
Expand All @@ -71,14 +73,16 @@ module.exports = function(modulus) {
help.add('start', function() {
this.line('project start'.verbose);
this.line('Starts a running project'.input);
this.line(' options:'.input);
this.line(' -p, --project-name Name of the project to start. Prompts are skipped when specified.'.input);
});

modulus.program
.command('project start')
.description('Starts a stopped project.')
.on('--help', help.commands.create)
.action(function() {
modulus.runCommand(modulus.commands.project.start, true);
modulus.runCommand(modulus.commands.project.start, [modulus.program.projectName], true);
});

// deploy command
Expand Down

0 comments on commit 4e9f8bd

Please sign in to comment.