Skip to content

Commit

Permalink
updated nimble file so that I never leave debug on again
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayvallurupalli committed Dec 4, 2024
1 parent fb1a303 commit 38cf687
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions chess.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 38cf687

Please sign in to comment.