Introduce gPrefixDir for nimsuggest.
This commit is contained in:
parent
2782cddb56
commit
2f68b0baf0
1 changed files with 8 additions and 2 deletions
|
|
@ -146,6 +146,7 @@ const
|
||||||
var
|
var
|
||||||
gConfigVars* = newStringTable(modeStyleInsensitive)
|
gConfigVars* = newStringTable(modeStyleInsensitive)
|
||||||
gDllOverrides = newStringTable(modeCaseInsensitive)
|
gDllOverrides = newStringTable(modeCaseInsensitive)
|
||||||
|
gPrefixDir* = "" # Overrides the default prefix dir in getPrefixDir proc.
|
||||||
libpath* = ""
|
libpath* = ""
|
||||||
gProjectName* = "" # holds a name like 'nimrod'
|
gProjectName* = "" # holds a name like 'nimrod'
|
||||||
gProjectPath* = "" # holds a path like /home/alice/projects/nimrod/compiler/
|
gProjectPath* = "" # holds a path like /home/alice/projects/nimrod/compiler/
|
||||||
|
|
@ -184,8 +185,13 @@ proc getOutFile*(filename, ext: string): string =
|
||||||
else: result = changeFileExt(filename, ext)
|
else: result = changeFileExt(filename, ext)
|
||||||
|
|
||||||
proc getPrefixDir*(): string =
|
proc getPrefixDir*(): string =
|
||||||
## gets the application directory
|
## Gets the prefix dir, usually the parent directory where the binary resides.
|
||||||
result = splitPath(getAppDir()).head
|
##
|
||||||
|
## This is overrided by some tools (namely nimsuggest) via the ``gPrefixDir``
|
||||||
|
## global.
|
||||||
|
if gPrefixDir != "": result = gPrefixDir
|
||||||
|
else:
|
||||||
|
result = splitPath(getAppDir()).head
|
||||||
|
|
||||||
proc canonicalizePath*(path: string): string =
|
proc canonicalizePath*(path: string): string =
|
||||||
when not FileSystemCaseSensitive: result = path.expandFilename.toLower
|
when not FileSystemCaseSensitive: result = path.expandFilename.toLower
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue