mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-25 12:25:08 +00:00
Add procs to retrieve project name, directory and full path to nimscript (#9274)
This commit is contained in:
@@ -96,6 +96,12 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string;
|
||||
cbconf fileExists:
|
||||
setResult(a, os.fileExists(a.getString 0))
|
||||
|
||||
cbconf projectName:
|
||||
setResult(a, conf.projectName)
|
||||
cbconf projectDir:
|
||||
setResult(a, conf.projectPath.string)
|
||||
cbconf projectPath:
|
||||
setResult(a, conf.projectFull.string)
|
||||
cbconf thisDir:
|
||||
setResult(a, vthisDir)
|
||||
cbconf put:
|
||||
|
||||
@@ -269,6 +269,18 @@ proc nimcacheDir*(): string =
|
||||
## Retrieves the location of 'nimcache'.
|
||||
builtin
|
||||
|
||||
proc projectName*(): string =
|
||||
## Retrieves the name of the current project
|
||||
builtin
|
||||
|
||||
proc projectDir*(): string =
|
||||
## Retrieves the absolute directory of the current project
|
||||
builtin
|
||||
|
||||
proc projectPath*(): string =
|
||||
## Retrieves the absolute path of the current project
|
||||
builtin
|
||||
|
||||
proc thisDir*(): string =
|
||||
## Retrieves the location of the current ``nims`` script file.
|
||||
builtin
|
||||
|
||||
Reference in New Issue
Block a user