Fixed getPkgDir
This commit is contained in:
parent
e7f8cb6c81
commit
5fcd7e5965
3 changed files with 9 additions and 2 deletions
|
|
@ -388,7 +388,7 @@ proc execScript(scriptName: string, flags: Flags, options: Options): PSym =
|
||||||
|
|
||||||
# Setup builtins defined in nimscriptapi.nim
|
# Setup builtins defined in nimscriptapi.nim
|
||||||
template cbApi(name, body) {.dirty.} =
|
template cbApi(name, body) {.dirty.} =
|
||||||
vm.globalCtx.registerCallback pkgName & "." & astToStr(name),
|
vm.globalCtx.registerCallback "nimscriptapi." & astToStr(name),
|
||||||
proc (a: VmArgs) =
|
proc (a: VmArgs) =
|
||||||
body
|
body
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ task repeated, "Testing `nimble c nimscript.nim` with repeated flags":
|
||||||
setCommand "c", "nimscript.nim"
|
setCommand "c", "nimscript.nim"
|
||||||
|
|
||||||
task api, "Testing nimscriptapi module functionality":
|
task api, "Testing nimscriptapi module functionality":
|
||||||
echo(getPkgDir())
|
echo("PKG_DIR: ", getPkgDir())
|
||||||
|
|
||||||
before hooks:
|
before hooks:
|
||||||
echo("First")
|
echo("First")
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,13 @@ test "pre hook can prevent action":
|
||||||
check(not inLines(lines, "Shouldn't happen"))
|
check(not inLines(lines, "Shouldn't happen"))
|
||||||
check inLines(lines, "Hook prevented further execution")
|
check inLines(lines, "Hook prevented further execution")
|
||||||
|
|
||||||
|
test "nimble script api":
|
||||||
|
cd "nimscript":
|
||||||
|
let (output, exitCode) = execNimble("api")
|
||||||
|
let lines = output.strip.splitLines()
|
||||||
|
check exitCode == QuitSuccess
|
||||||
|
check inLines(lines, "PKG_DIR: " & getCurrentDir())
|
||||||
|
|
||||||
test "can install packagebin2":
|
test "can install packagebin2":
|
||||||
let args = ["install", "-y", "https://github.com/nimble-test/packagebin2.git"]
|
let args = ["install", "-y", "https://github.com/nimble-test/packagebin2.git"]
|
||||||
check execNimble(args).exitCode == QuitSuccess
|
check execNimble(args).exitCode == QuitSuccess
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue