Enable Travis folding in winrelease (#10528)
This commit is contained in:
parent
ad4e3fd28c
commit
07553034de
2 changed files with 21 additions and 12 deletions
|
|
@ -25,7 +25,6 @@ proc findNim*(): string =
|
|||
# assume there is a symlink to the exe or something:
|
||||
return nim
|
||||
|
||||
|
||||
proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
|
||||
let prevPath = getEnv("PATH")
|
||||
if additionalPath.len > 0:
|
||||
|
|
@ -38,14 +37,20 @@ proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
|
|||
if execShellCmd(cmd) != 0: quit("FAILURE", errorcode)
|
||||
putEnv("PATH", prevPath)
|
||||
|
||||
template inFold*(desc, body) =
|
||||
if existsEnv("TRAVIS"):
|
||||
echo "travis_fold:start:" & desc.replace(" ", "_")
|
||||
|
||||
body
|
||||
|
||||
if existsEnv("TRAVIS"):
|
||||
echo "travis_fold:end:" & desc.replace(" ", "_")
|
||||
|
||||
proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
|
||||
## Execute shell command. Add log folding on Travis CI.
|
||||
# https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719
|
||||
if existsEnv("TRAVIS"):
|
||||
echo "travis_fold:start:" & desc.replace(" ", "_")
|
||||
exec(cmd, errorcode, additionalPath)
|
||||
if existsEnv("TRAVIS"):
|
||||
echo "travis_fold:end:" & desc.replace(" ", "_")
|
||||
inFold(desc):
|
||||
exec(cmd, errorcode, additionalPath)
|
||||
|
||||
proc execCleanPath*(cmd: string,
|
||||
additionalPath = ""; errorcode: int = QuitFailure) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue