Skip to content

Commit

Permalink
some runner fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fjakobs committed May 17, 2012
1 parent e37d6ab commit 9bde115
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugins-server/cloud9.run.node-debug/node_debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var exports = module.exports = function setup(options, imports, register) {

exports.factory = function(vfs, workspaceDir) {
return function(args, eventEmitter, eventName) {
var cwd = args.cwd || ide.workspaceDir;
var cwd = args.cwd || workspaceDir;
return new Runner(vfs, {
file: args.file,
args: args.args,
Expand Down
2 changes: 1 addition & 1 deletion plugins-server/cloud9.run.node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ var Runner = exports.Runner = function(vfs, options) {
this.file = options.file;
this.extra = options.extra;


this.scriptArgs = options.args || [];
this.nodeArgs = [];

Expand All @@ -61,6 +60,7 @@ util.inherits(Runner, ShellRunner);
this.name = "node";

this.createChild = function(callback) {
this.command = process.execPath;
this.args = this.nodeArgs.concat(this.file, this.scriptArgs);
ShellRunner.prototype.createChild.call(this, callback);
};
Expand Down
10 changes: 5 additions & 5 deletions plugins-server/cloud9.run.shell/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ var Runner = exports.Runner = function(vfs, options) {
if (options.cwd)
this.runOptions.cwd = options.cwd;

if (this.encoding) {
this.runOptions.stdoutEncoding = this.encoding;
this.runOptions.stderrEncoding = this.encoding;
}

var env = options.env || {};

for (var key in process.env)
Expand Down Expand Up @@ -121,11 +126,6 @@ var Runner = exports.Runner = function(vfs, options) {
child.stdout.on("data", sender("stdout"));
child.stderr.on("data", sender("stderr"));

if (this.encoding) {
child.stdout.setEncoding(this.encoding);
child.stderr.setEncoding(this.encoding);
}

function emit(msg) {
// console.log(self.eventName, msg);
self.eventEmitter.emit(self.eventName, msg);
Expand Down

0 comments on commit 9bde115

Please sign in to comment.