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"
148' href='#n148'>148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222