Fixes #606. Build before/after hook executed every time package is built.
This commit is contained in:
parent
4a2aaa07dc
commit
137bb1ed07
4 changed files with 40 additions and 15 deletions
|
|
@ -54,3 +54,9 @@ before install:
|
|||
|
||||
after install:
|
||||
echo("After PkgDir: ", getPkgDir())
|
||||
|
||||
before build:
|
||||
echo("Before build")
|
||||
|
||||
after build:
|
||||
echo("After build")
|
||||
|
|
@ -286,12 +286,21 @@ suite "nimscript":
|
|||
cd "nimscript":
|
||||
let (output, exitCode) = execNimble(["install", "-y"])
|
||||
check exitCode == QuitSuccess
|
||||
check output.contains("Before build")
|
||||
check output.contains("After build")
|
||||
let lines = output.strip.processOutput()
|
||||
check lines[0].startsWith("Before PkgDir:")
|
||||
check lines[0].endsWith("tests" / "nimscript")
|
||||
check lines[^1].startsWith("After PkgDir:")
|
||||
check lines[^1].endsWith("tests" / "nimbleDir" / "pkgs" / "nimscript-0.1.0")
|
||||
|
||||
test "before/after on build":
|
||||
cd "nimscript":
|
||||
let (output, exitCode) = execNimble(["build"])
|
||||
check exitCode == QuitSuccess
|
||||
check output.contains("Before build")
|
||||
check output.contains("After build")
|
||||
|
||||
test "can execute nimscript tasks":
|
||||
cd "nimscript":
|
||||
let (output, exitCode) = execNimble("--verbose", "work")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue