summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/commands.nim5
-rw-r--r--compiler/options.nim6
2 files changed, 7 insertions, 4 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 3daab170c..1ddc85b23 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -331,10 +331,7 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) =
       nimblePath(path, info)
   of "nonimblepath", "nobabelpath":
     expectNoArg(switch, arg, pass, info)
-    options.gNoNimblePath = true
-    options.lazyPaths.head = nil
-    options.lazyPaths.tail = nil
-    options.lazyPaths.counter = 0
+    disableNimblePath()
   of "excludepath":
     expectArg(switch, arg, pass, info)
     let path = processPath(arg, info)
diff --git a/compiler/options.nim b/compiler/options.nim
index 50f12d843..e7c9346a7 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -254,6 +254,12 @@ proc removeTrailingDirSep*(path: string): string =
   else:
     result = path
 
+proc disableNimblePath*() =
+  gNoNimblePath = true
+  lazyPaths.head = nil
+  lazyPaths.tail = nil
+  lazyPaths.counter = 0
+
 include packagehandling
 
 proc getNimcacheDir*: string =