summary refs log tree commit diff stats
path: root/tests/testament/categories.nim
diff options
context:
space:
mode:
authorXiao-Yong <jinxiaoyong@gmail.com>2017-10-28 02:38:31 -0500
committerAndreas Rumpf <rumpf_a@web.de>2017-10-28 09:38:31 +0200
commit616db85c615d9cf00a1c3b85e59cf6401fed915b (patch)
treed1eba13b7a7006641aa168926a9a808265253109 /tests/testament/categories.nim
parent93fd0b0cb5911c8d313988f39a20bcdbc851f6cb (diff)
downloadNim-616db85c615d9cf00a1c3b85e59cf6401fed915b.tar.gz
Let the environment variable NIMBLE_DIR overrides nimblepath in cfg file (#6542)
* Let the environment variable NIMBLE_DIR overrides nimblepath in cfg file

If the length of NIMBLE_DIR is larger than zero, the nimblepath
will be set to $NIMBLE_DIR/pkgs
Diffstat (limited to 'tests/testament/categories.nim')
-rw-r--r--tests/testament/categories.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim
index d620a4587..675ff946f 100644
--- a/tests/testament/categories.nim
+++ b/tests/testament/categories.nim
@@ -324,9 +324,10 @@ type PackageFilter = enum
   pfExtraOnly
   pfAll
 
+var nimbleDir = getEnv("NIMBLE_DIR").string
+if nimbleDir.len == 0: nimbleDir = getHomeDir() / ".nimble"
 let
   nimbleExe = findExe("nimble")
-  nimbleDir = getHomeDir() / ".nimble"
   packageDir = nimbleDir / "pkgs"
   packageIndex = nimbleDir / "packages.json"