Skip to content

fix(build): binary execution on windows #1675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions tools/gulp/task_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function execTask(binPath: string, args: string[], options: ExecTaskOptio
done();
}
});
}
};
}

/**
Expand All @@ -135,11 +135,13 @@ export function execNodeTask(packageName: string, executable: string | string[],
if (err) {
done(err);
} else {
// Forward to execTask.
execTask(binPath, args, options)(done);
// Execute the node binary within a new child process using spawn.
// The binary needs to be `node` because on Windows the shell cannot determine the correct
// interpreter from the shebang.
execTask('node', [binPath].concat(args), options)(done);
}
});
}
};
}


Expand Down Expand Up @@ -185,7 +187,7 @@ export function vendorTask() {


/** Create a task that serves the dist folder. */
export function serverTask(liveReload: boolean = true,
export function serverTask(liveReload = true,
streamCallback: (stream: NodeJS.ReadWriteStream) => void = null) {
return () => {
const stream = gulp.src('dist').pipe(gulpServer({
Expand All @@ -198,7 +200,7 @@ export function serverTask(liveReload: boolean = true,
streamCallback(stream);
}
return stream;
}
};
}


Expand All @@ -209,5 +211,5 @@ export function sequenceTask(...args: any[]) {
...args,
done
);
}
};
}