Skip to content

Commit

Permalink
sm ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
cadorn committed Sep 28, 2012
1 parent cd33449 commit a4dd227
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/commands/ssh.js
@@ -0,0 +1,30 @@

var ARGS_PARSER = require("sourcemint-util-js/lib/args").Parser;
var CLI = require("../cli");
var PM = require("sourcemint-pm-sm/lib/pm");
var Q = require("sourcemint-util-js/lib/q");


var command = exports["ssh"] = new ARGS_PARSER();

command.help("SSH to a deployed package/program.");
command.arg(".../[package.json|program.json]");
command.helpful();

command.action(function (options) {

var basePath = CLI.checkPackageProgramPathInArguments(options.args);
if (!basePath) {
return;
}

PM.forProgramPath(basePath).then(function(pm) {
return PM.forPackagePath(null, pm).then(function(pm) {
return pm.ssh(options);
});
}).then(function() {
process.exit(0);
}).fail(function(err) {
CLI.failAndExit(err);
});
});

0 comments on commit a4dd227

Please sign in to comment.