From 6569564aa8c9a906361ae15eab7197a9662f9d34 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Wed, 15 Nov 2017 23:00:40 -0600 Subject: [PATCH] Update to work with latest Nim devel and cliutil updates. --- src/main/nim/strawbosspkg/core.nim | 13 +++++-------- src/test/nim/run_functional_tests.nim | 2 +- src/test/nim/run_unit_tests.nim | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/nim/strawbosspkg/core.nim b/src/main/nim/strawbosspkg/core.nim index e9ffd7e..6ff153b 100644 --- a/src/main/nim/strawbosspkg/core.nim +++ b/src/main/nim/strawbosspkg/core.nim @@ -53,7 +53,7 @@ proc setupProject(wksp: Workspace) = ["clone", wksp.projectDef.repo, "repo"], wksp.env, {poUsePath}, wksp.outputHandler) - if cloneResult.exitCode != 0: + if cloneResult != 0: raiseEx "unable to clone repo for '" & wksp.projectDef.name & "'" # Checkout the requested ref @@ -61,7 +61,7 @@ proc setupProject(wksp: Workspace) = ["checkout", wksp.buildRef], wksp.env, {poUsePath}, wksp.outputHandler) - if checkoutResult.exitCode != 0: + if checkoutResult != 0: raiseEx "unable to checkout ref " & wksp.buildRef & " for '" & wksp.projectDef.name & "'" @@ -77,16 +77,13 @@ proc setupProject(wksp: Workspace) = for k, v in wksp.projectDef.envVars: wksp.env[k] = v # Get the build version - let versionProc = startProcess( + let versionResult = execWithOutput( wksp.project.versionCmd, # command wksp.dir & "/repo", # working dir [], # args wksp.env, # environment {poUsePath, poEvalCommand}) # options - let versionResult = waitForWithOutput(versionProc, wksp.outputHandler, - wksp.project.versionCmd) - if versionResult.exitCode != 0: raiseEx "Version command (" & wksp.project.versionCmd & ") returned non-zero exit code." @@ -140,9 +137,9 @@ proc runStep*(wksp: Workspace, step: Step) = cmdInStream.flush() cmdInStream.close() - let cmdResult = waitForWithOutput(cmdProc, wksp.outputHandler, step.stepCmd) + let cmdResult = waitFor(cmdProc, wksp.outputHandler, step.stepCmd) - if cmdResult.exitCode != 0: + if cmdResult != 0: raiseEx "step " & step.name & " failed: step command returned non-zero exit code" # Gather the output artifacts (if we have any) diff --git a/src/test/nim/run_functional_tests.nim b/src/test/nim/run_functional_tests.nim index 4b27be0..5a4a6c3 100644 --- a/src/test/nim/run_functional_tests.nim +++ b/src/test/nim/run_functional_tests.nim @@ -1,3 +1,3 @@ import unittest -import ./functional/tserver.nim +import ./functional/tserver diff --git a/src/test/nim/run_unit_tests.nim b/src/test/nim/run_unit_tests.nim index 692e673..b31bf51 100644 --- a/src/test/nim/run_unit_tests.nim +++ b/src/test/nim/run_unit_tests.nim @@ -1,4 +1,4 @@ import unittest -import ./unit/tserver.nim -import ./unit/tconfiguration.nim +import ./unit/tserver +import ./unit/tconfiguration