From 47c7909e76b8f1e022e8a0688e0d6af288247429 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 6 Mar 2016 11:31:13 -0800 Subject: [PATCH] Add watch.js for non-5 stages --- stages/1/package.json | 2 +- stages/1/watch.js | 7 +++++++ stages/2/package.json | 2 +- stages/2/watch.js | 7 +++++++ stages/3/package.json | 2 +- stages/3/watch.js | 7 +++++++ stages/4/package.json | 2 +- stages/4/watch.js | 7 +++++++ stages/6/package.json | 2 +- stages/6/watch.js | 7 +++++++ stages/7/package.json | 2 +- stages/7/watch.js | 7 +++++++ stages/8/package.json | 2 +- stages/8/watch.js | 7 +++++++ stages/9/package.json | 2 +- stages/9/watch.js | 7 +++++++ 16 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 stages/1/watch.js create mode 100644 stages/2/watch.js create mode 100644 stages/3/watch.js create mode 100644 stages/4/watch.js create mode 100644 stages/6/watch.js create mode 100644 stages/7/watch.js create mode 100644 stages/8/watch.js create mode 100644 stages/9/watch.js diff --git a/stages/1/package.json b/stages/1/package.json index 493ecf6..5333191 100644 --- a/stages/1/package.json +++ b/stages/1/package.json @@ -4,7 +4,7 @@ "description": "Like GitHub, but for Elm stuff.", "scripts": { "build": "elm-make src/ElmHub.elm --output elm.js", - "watch": "../../node_modules/.bin/elm-live src/ElmHub.elm --open -- --output=elm.js", + "watch": "node watch.js", "install": "npm run build" }, "repository": { diff --git a/stages/1/watch.js b/stages/1/watch.js new file mode 100644 index 0000000..69f87fd --- /dev/null +++ b/stages/1/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/ElmHub.elm --open -- --output=elm.js", { stdio: "inherit" }); diff --git a/stages/2/package.json b/stages/2/package.json index 493ecf6..5333191 100644 --- a/stages/2/package.json +++ b/stages/2/package.json @@ -4,7 +4,7 @@ "description": "Like GitHub, but for Elm stuff.", "scripts": { "build": "elm-make src/ElmHub.elm --output elm.js", - "watch": "../../node_modules/.bin/elm-live src/ElmHub.elm --open -- --output=elm.js", + "watch": "node watch.js", "install": "npm run build" }, "repository": { diff --git a/stages/2/watch.js b/stages/2/watch.js new file mode 100644 index 0000000..69f87fd --- /dev/null +++ b/stages/2/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/ElmHub.elm --open -- --output=elm.js", { stdio: "inherit" }); diff --git a/stages/3/package.json b/stages/3/package.json index 493ecf6..5333191 100644 --- a/stages/3/package.json +++ b/stages/3/package.json @@ -4,7 +4,7 @@ "description": "Like GitHub, but for Elm stuff.", "scripts": { "build": "elm-make src/ElmHub.elm --output elm.js", - "watch": "../../node_modules/.bin/elm-live src/ElmHub.elm --open -- --output=elm.js", + "watch": "node watch.js", "install": "npm run build" }, "repository": { diff --git a/stages/3/watch.js b/stages/3/watch.js new file mode 100644 index 0000000..69f87fd --- /dev/null +++ b/stages/3/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/ElmHub.elm --open -- --output=elm.js", { stdio: "inherit" }); diff --git a/stages/4/package.json b/stages/4/package.json index 493ecf6..5333191 100644 --- a/stages/4/package.json +++ b/stages/4/package.json @@ -4,7 +4,7 @@ "description": "Like GitHub, but for Elm stuff.", "scripts": { "build": "elm-make src/ElmHub.elm --output elm.js", - "watch": "../../node_modules/.bin/elm-live src/ElmHub.elm --open -- --output=elm.js", + "watch": "node watch.js", "install": "npm run build" }, "repository": { diff --git a/stages/4/watch.js b/stages/4/watch.js new file mode 100644 index 0000000..69f87fd --- /dev/null +++ b/stages/4/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/ElmHub.elm --open -- --output=elm.js", { stdio: "inherit" }); diff --git a/stages/6/package.json b/stages/6/package.json index 99620c2..e99bfc7 100644 --- a/stages/6/package.json +++ b/stages/6/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/6/watch.js b/stages/6/watch.js new file mode 100644 index 0000000..c6309e1 --- /dev/null +++ b/stages/6/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" }); diff --git a/stages/7/package.json b/stages/7/package.json index 99620c2..e99bfc7 100644 --- a/stages/7/package.json +++ b/stages/7/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/7/watch.js b/stages/7/watch.js new file mode 100644 index 0000000..c6309e1 --- /dev/null +++ b/stages/7/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" }); diff --git a/stages/8/package.json b/stages/8/package.json index 99620c2..e99bfc7 100644 --- a/stages/8/package.json +++ b/stages/8/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/8/watch.js b/stages/8/watch.js new file mode 100644 index 0000000..c6309e1 --- /dev/null +++ b/stages/8/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" }); diff --git a/stages/9/package.json b/stages/9/package.json index 4bc8cb7..a172a90 100644 --- a/stages/9/package.json +++ b/stages/9/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", "css": "../../node_modules/.bin/elm-css css/Stylesheets.elm", "test": "node test.js", "install": "npm run build" diff --git a/stages/9/watch.js b/stages/9/watch.js new file mode 100644 index 0000000..c6309e1 --- /dev/null +++ b/stages/9/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" });