mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-13 19:27:53 -06:00
Compare commits
No commits in common. "add7992106cacc12a6dbdd96bb5c8390e0a903a6" and "b020fe023024e499504a633ced2733ddf61400ff" have entirely different histories.
add7992106
...
b020fe0230
2 changed files with 5 additions and 19 deletions
|
@ -19,23 +19,11 @@ proc runCmd*(cmd: string): int =
|
|||
proc runCmdCapt*(cmd: string): tuple[stdout, stderr: string, exitCode: int] =
|
||||
let args = cmd.splitWhitespace()
|
||||
let p = startProcess(args[0], args = args[1..^1], options = {poUsePath})
|
||||
let ostrm = outputStream p
|
||||
let errstrm = errorStream p
|
||||
result.exitCode = -1
|
||||
var line = newStringOfCap(120)
|
||||
while true:
|
||||
if ostrm.readLine(line):
|
||||
result.stdout.add line & '\n'
|
||||
if errstrm.readLine(line):
|
||||
result.stderr.add line & '\n'
|
||||
result.exitCode = peekExitCode(p)
|
||||
if result.exitCode != -1: break
|
||||
|
||||
# result = (
|
||||
# readAll p.outputStream,
|
||||
# readAll p.errorStream,
|
||||
# waitForExit p
|
||||
# )
|
||||
result = (
|
||||
readAll p.outputStream,
|
||||
readAll p.errorStream,
|
||||
waitForExit p
|
||||
)
|
||||
close p
|
||||
|
||||
proc runCmdCaptWithSpinner*(cmd: string, msg: string = ""): tuple[output, err: string] =
|
||||
|
|
|
@ -110,8 +110,6 @@ proc toBuildNixosConfiguration(): seq[string] =
|
|||
var cmd = nixCommand("build")
|
||||
cmd.addArg "--dry-run"
|
||||
cmd.addArgs nixosConfigAttrs()
|
||||
debug "trying with ouptut"
|
||||
discard execCmd(cmd)
|
||||
let (_, err) = runCmdCaptWithSpinner(cmd, "running dry run build for: " & getHosts().join(" "))
|
||||
let output = parseDryRunOutput err
|
||||
return output.toBuild.mapIt(it.storePath)
|
||||
|
|
Loading…
Reference in a new issue