Skip to content

Commit

Permalink
fix the eventemitter2 difference of having an event argument
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeck committed Jul 21, 2011
1 parent f1775c1 commit 9a6f20d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/carapace.js
Expand Up @@ -105,6 +105,7 @@ carapace.run = function (argv, callback) {

evref.unref();
carapace.running = true;

argv[0] = fs.realpathSync(require.resolve(path.join(process.cwd(), argv[0])));

for (var i = 0; i < argv.length;) {
Expand Down
6 changes: 5 additions & 1 deletion lib/plugins/chdir.js
Expand Up @@ -3,10 +3,14 @@ var path = require('path');
module.exports = function chdirPlugin (carapace) {
if (!carapace.chdir) {
carapace.chdir = function (value, done) {
console.dir(arguments)
console.log('changed cwd')
process.chdir(path.resolve(value));
return done ? done() : null;
};

carapace.on('chdir:path', carapace.chdir);
carapace.on('chdir:path', function(event, value, done) {
carapace.chdir.apply(this, [].slice.call(arguments,1))
});
}
}
4 changes: 3 additions & 1 deletion lib/plugins/chroot.js
Expand Up @@ -7,6 +7,8 @@ module.exports = function (carapace) {
return done ? done() : null;
};

carapace.on('chroot:root', carapace.chroot);
carapace.on('chroot:root', function() {
carapace.chroot.apply(this, [].slice.call(arguments,1))
});
}
};

0 comments on commit 9a6f20d

Please sign in to comment.