diff --git a/default.nix b/default.nix index 8b681a9..a33fad2 100644 --- a/default.nix +++ b/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { buildInputs = [ elmPackages.elm ninja nodePackages.uglify-js ]; buildPhase = '' ./script/ninja.sh > build.ninja - env ELM_HOME=.elm ninja + env ELM_HOME=.elm ELM_FLAGS= ninja ''; installPhase = "cp -r dist/ $out/"; diff --git a/modd.conf b/modd.conf index 9b6a63d..a16daeb 100644 --- a/modd.conf +++ b/modd.conf @@ -1,9 +1,9 @@ script/ninja.sh { - prep: ./script/ninja.sh > build.ninja && ninja + prep: ./script/ninja.sh > build.ninja && env ELM_FLAGS=--debug ninja } src/** vendor/** { - prep: ninja + prep: env ELM_FLAGS=--debug ninja } dist/** { diff --git a/script/elm-make-module.sh b/script/elm-make-module.sh index f03b875..e6ee10e 100755 --- a/script/elm-make-module.sh +++ b/script/elm-make-module.sh @@ -4,14 +4,14 @@ set -euo pipefail IN="${1:-}" OUT="${2:-}" -FLAGS="${@:3}" +ELM_FLAGS="${ELM_FLAGS:-}" if test -z "$IN" || test -z "$OUT"; then echo "usage: ${0:-} src/Main.elm dist/elm.js --optimize" exit 1 fi -elm make "$FLAGS" --output="$OUT" "$IN" +elm make $ELM_FLAGS --output="$OUT" "$IN" # change the cmpiled elm file to not immediately call the compiled function sed -i 's/(function(scope/function init(scope/g' "$OUT" diff --git a/script/ninja.sh b/script/ninja.sh index b8d58b2..4982286 100755 --- a/script/ninja.sh +++ b/script/ninja.sh @@ -4,10 +4,8 @@ set -eou pipefail ELM_FILES="$(find src -name '*.elm')" cat < \$out