summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-10-09 13:13:40 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-10-09 13:13:45 +0200
commitc96295b380c2529ee3bfa5523ec477400d021b17 (patch)
treea7fce23f3467d7ccefadcda03d99d3a86819f41c
parent08913db9244b67295e31c49f5ffbc1faa36638d7 (diff)
downloadNim-c96295b380c2529ee3bfa5523ec477400d021b17.tar.gz
better error checking for install_tools.nims script
-rw-r--r--install_tools.nims19
1 files changed, 11 insertions, 8 deletions
diff --git a/install_tools.nims b/install_tools.nims
index 6ecc545a5..e211ff491 100644
--- a/install_tools.nims
+++ b/install_tools.nims
@@ -3,13 +3,16 @@ import ospaths
 
 mode = ScriptMode.Verbose
 
-let nimbleExe = "./bin/nimble".toExe
-selfExec "c --noNimblePath -p:compiler -o:" & nimbleExe &
-    " dist/nimble/src/nimble.nim"
+if not dirExists"dist/nimble":
+  echo "[Error] This script only works for the tarball."
+else:
+  let nimbleExe = "./bin/nimble".toExe
+  selfExec "c --noNimblePath -p:compiler -o:" & nimbleExe &
+      " dist/nimble/src/nimble.nim"
 
-let nimsugExe = "./bin/nimsuggest".toExe
-selfExec "c --noNimblePath -p:compiler -o:" & nimsugExe &
-    " dist/nimsuggest/nimsuggest.nim"
+  let nimsugExe = "./bin/nimsuggest".toExe
+  selfExec "c --noNimblePath -p:compiler -o:" & nimsugExe &
+      " dist/nimsuggest/nimsuggest.nim"
 
-let nimgrepExe = "./bin/nimgrep".toExe
-selfExec "c -o:./bin/nimgrep tools/nimgrep.nim"
+  let nimgrepExe = "./bin/nimgrep".toExe
+  selfExec "c -o:./bin/nimgrep tools/nimgrep.nim"