diff options
author | Marvin Borner | 2020-07-18 17:44:30 +0200 |
---|---|---|
committer | Marvin Borner | 2020-07-18 17:44:30 +0200 |
commit | ecbb3c7420ebb63d9a870760df602b27cef82939 (patch) | |
tree | eccc328286f2ad0935757c3556e3b7d79815b70f | |
parent | 34a3f2f132791ad33e6a6b59371bb6f029436ab4 (diff) |
Added debug mode
-rw-r--r-- | .example.env | 15 | ||||
-rwxr-xr-x | run | 12 |
2 files changed, 19 insertions, 8 deletions
diff --git a/.example.env b/.example.env index 8a29b86..cf2212d 100644 --- a/.example.env +++ b/.example.env @@ -1,6 +1,11 @@ -PORT=<PORT> # Optional +# This file is just a template +# Please copy it to .env and replace its values! -DBUser=<Database username> -DBPassword=<Database user password> -DBName=<Databse name> -DBHost=<Database host>
\ No newline at end of file +DEBUG=0 + +PORT=8080 + +DBUser=DatabaseUser +DBPassword=DatabasePassword +DBName=DatabaseName +DBHost=DatabaseHost @@ -1,4 +1,10 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -deno test test/ && - deno run -q --allow-net --allow-env --allow-read --unstable src/main.ts +ARGS=(--allow-net --allow-env --allow-read --unstable) + +if grep -q "DEBUG=1" .env; then + deno test "${ARGS[@]}" test/ && + deno run "${ARGS[@]}" src/main.ts +else + deno run "${ARGS[@]}" src/main.ts +fi |