From e7c4767f8f7a1c17ca99a73166320341fd8df070 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 6 Mar 2016 11:28:02 -0800 Subject: [PATCH] Fix 5's npm run watch on Windows --- stages/5/package.json | 2 +- stages/5/watch.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 stages/5/watch.js diff --git a/stages/5/package.json b/stages/5/package.json index 99620c2..e99bfc7 100644 --- a/stages/5/package.json +++ b/stages/5/package.json @@ -4,7 +4,7 @@ "description": "Like GitHub, but for Elm stuff.", "scripts": { "build": "elm-make src/Main.elm --output elm.js", - "watch": "../../node_modules/.bin/elm-live src/Main.elm --open -- --output=elm.js", + "watch": "node watch.js", "test": "node test.js", "install": "npm run build" }, diff --git a/stages/5/watch.js b/stages/5/watch.js new file mode 100644 index 0000000..c6309e1 --- /dev/null +++ b/stages/5/watch.js @@ -0,0 +1,7 @@ +var fs = require("fs"); +var execSync = require("child_process").execSync; +var path = require("path"); +var binPath = path.join(__dirname, "..", "..", "node_modules", ".bin"); +var watchPath = path.join(binPath, "elm-live"); + +execSync(watchPath + " src/Main.elm --open -- --output=elm.js", { stdio: "inherit" });