diff --git a/chess.nimble b/chess.nimble index b0a4871..86b2467 100644 --- a/chess.nimble +++ b/chess.nimble @@ -15,17 +15,15 @@ requires "nim >= 2.0.8" requires "karax >= 1.3.3" #Tasks -task html, "compiles html in main.nim": - exec "karun src/main.nim" - exec "awk '{sub(\"/app.js\",\"./app.js\")}1' app.html > app/app.html" - exec "rm app.html app/app.js || :" - exec "mv app.js app" - task jsc, "compiles just the js, instead of doing all that rewriting": exec "nim js --out:app.js src/main.nim" -task jscr, "compiles for release": - exec "nim js --out:app.js -d:release src/main.nim" +task jscr, "compiles for release": + try : + exec "grep 'debug: bool = false' src/main.nim" #this will do nothing if true, and error if false + exec "nim js --out:app.js -d:release src/main.nim" + except OSError: + echo "YOU FORGOT TO TURN OFF THE DEBUG SWITCH. STUPID STUPID STUPID." task host, "hosts app.html, build from main.nim with task html": exec "npx parcel app/app.html"