aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--README.md4
-rwxr-xr-xgen5
-rw-r--r--package.json18
4 files changed, 21 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 254a354..32e9bab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ public/javascripts/client.js
sessionKey
deploy
kimsufi.tar.gz
+node_modules
diff --git a/README.md b/README.md
index 8cfbe01..42a3802 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Share costs with a group of people.
```
cabal sandbox init
cabal install --only-dependencies
-cabal build
elm package install
-./dist/build/sharedCost/sharedCost
+npm install
+npm run watch
```
diff --git a/gen b/gen
deleted file mode 100755
index 5e5358d..0000000
--- a/gen
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-trap 'fuser -k 3000/tcp' EXIT
-elm-make src/client/Main.elm --output public/javascripts/client.js \
- && cabal build \
- && ./dist/build/sharedCost/sharedCost
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..ad80280
--- /dev/null
+++ b/package.json
@@ -0,0 +1,18 @@
+{
+ "devDependencies": {
+ "watch": "0.16.0"
+ },
+ "scripts": {
+ "watch": "npm run watch-server & npm run watch-client",
+ "watch-server": "watch 'npm run build-and-launch-server' src/server",
+ "watch-client": "watch 'npm run build-client' src/client",
+
+ "build": "npm run build-server && npm run build-client",
+ "build-server": "cabal build",
+ "build-client": "elm make src/client/Main.elm --output public/javascripts/client.js",
+
+ "build-and-launch-server": "npm run build-server && npm run kill-server && npm run launch-server",
+ "launch-server": "./dist/build/sharedCost/sharedCost &",
+ "kill-server": "pkill sharedCost || true"
+ }
+}