Skip to content

Commit

Permalink
Support launching debugger in Windows. Ref #18
Browse files Browse the repository at this point in the history
Breakpoints still don't appear to work in Windows. Need testing.

Signed-off-by: Kaustav Das Modak <kaustav.dasmodak@yahoo.co.in>
  • Loading branch information
Kaustav Das Modak committed Feb 18, 2016
1 parent c903cbb commit 9000dc3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions debug.bat
@@ -0,0 +1,2 @@
@echo off
node-debug %1 %2
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -34,7 +34,8 @@ if(process.argv[2] === "--init") {

else if(process.argv[2] === "--start") {
if (process.env.DEBUG === "true") {
var debug_process = child_process.spawn("node-debug", ["./src/gauge.js", "--run"],
var node_debug = process.platform === "win32" ? "debug.bat" : "node-debug";
var debug_process = child_process.spawn(node_debug, ["./src/gauge.js", "--run"],
{ env: process.env, stdio: "inherit" });
debug_process.on("error", function (err) {
console.log(err.toString());
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.js
Expand Up @@ -33,7 +33,7 @@ var recreateDir = function (dirPath) {

var prepareFiles = function () {
var buildDir = localPath("build"),
copyList = ["gauge-proto", "src", "skel", "index.js", "index.bat", "js.json", "package.json", ".node-inspectorrc", "README.md"];
copyList = ["gauge-proto", "src", "skel", "index.js", "index.bat", "debug.bat", "js.json", "package.json", ".node-inspectorrc", "README.md"];

recreateDir(buildDir);

Expand Down

0 comments on commit 9000dc3

Please sign in to comment.