summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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"