Permalink
Browse files

more consistent interface for spawning

  • Loading branch information...
1 parent 51d3b63 commit d954a1e19024b0fe4d89c940170bd51f209bbbae @substack committed Mar 7, 2012
Showing with 18 additions and 3 deletions.
  1. +17 −2 index.js
  2. +1 −1 package.json
View
@@ -203,11 +203,19 @@ Propagit.prototype.createService = function (remote, conn) {
var procs = {};
drones.forEach(function (drone) {
- self.emit('spawn', drone.id, opts);
if (!opts.env) opts.env = {};
if (!opts.env.DRONE_ID) opts.env.DRONE_ID = drone.id;
drone.spawn(opts, function (pid) {
+ var opts_ = {};
+ Object.keys(opts).forEach(function (key) {
+ opts_[key] = opts[key];
+ });
+ opts_.drone = drone.id;
+ opts_.id = pid;
+
+ self.emit('spawn', opts_);
+
procs[drone.id] = pid;
if (--pending === 0) cb(null, procs);
});
@@ -412,7 +420,14 @@ Propagit.prototype.drone = function (fn) {
}
});
- self.emit('spawn', id, opts);
+ self.emit('spawn', {
+ drone : actions.id,
+ id : id,
+ repo : repo,
+ commit : commit,
+ command : opts.command,
+ cwd : dir,
+ });
})();
cb(id);
View
@@ -1,7 +1,7 @@
{
"name" : "propagit",
"description" : "cascading multi-server git deployment",
- "version" : "0.5.0",
+ "version" : "0.5.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/propagit.git"

0 comments on commit d954a1e

Please sign in to comment.