Browse files

stop works

  • Loading branch information...
1 parent 168624b commit ac7cb9374942051b891371ce7eef72c220263e61 @substack committed Mar 1, 2012
Showing with 29 additions and 2 deletions.
  1. +26 −0 bin/stop.js
  2. +3 −2 package.json
View
26 bin/stop.js
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+var argv = require('../lib/argv');
+var propagit = require('propagit');
+var git = require('../lib/git');
+
+var p = propagit(argv);
+p.on('error', function (err) {
+ console.dir(err);
+});
+
+if (argv._.length === 0) {
+ console.error('Usage: fleet stop PID');
+ process.exit();
+}
+
+p.hub(function (hub) {
+ var opts = {
+ drone : argv.drone,
+ drones : argv.drones,
+ pid : argv._[0].replace(/^pid#/, ''),
+ };
+ hub.stop(opts, function (drone) {
+ console.log('[' + drone + '] stopped ' + opts.pid);
+ p.hub.close();
+ });
+});
View
5 package.json
@@ -16,7 +16,8 @@
"fleet-list" : "bin/list.js",
"fleet-monitor" : "bin/monitor.js",
"fleet-router" : "bin/router.js",
- "fleet-spawn" : "bin/spawn.js"
+ "fleet-spawn" : "bin/spawn.js",
+ "fleet-stop" : "bin/stop.js"
},
"keywords" : [
"cluster",
@@ -32,7 +33,7 @@
"test" : "tap test/*.js"
},
"dependencies" : {
- "propagit" : "~0.4.3",
+ "propagit" : "~0.4.5",
"optimist" : "~0.3.1",
"mkdirp" : "~0.3.0"
},

0 comments on commit ac7cb93

Please sign in to comment.