Permalink
Browse files

sm ssh

  • Loading branch information...
1 parent cd33449 commit a4dd227205403572decb859c077b2218f98f7d68 @cadorn cadorn committed Sep 28, 2012
Showing with 30 additions and 0 deletions.
  1. +30 −0 lib/commands/ssh.js
View
@@ -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.