mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-09 20:33:15 -06:00
add better logger
This commit is contained in:
parent
2c0a80f86a
commit
dc40e7592e
1 changed files with 4 additions and 5 deletions
|
@ -178,7 +178,6 @@ func parseDryRun(buf string) (*packages, *packages) {
|
||||||
if i == 2 {
|
if i == 2 {
|
||||||
log.Fatal("failed to parse output", "output", buf)
|
log.Fatal("failed to parse output", "output", buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(line, " ") {
|
if strings.HasPrefix(line, " ") {
|
||||||
parts[i] = append(parts[i], line)
|
parts[i] = append(parts[i], line)
|
||||||
}
|
}
|
||||||
|
@ -209,7 +208,6 @@ func parseDryRun2(buf string) ([]string, []string) {
|
||||||
parts[i] = append(parts[i], strings.TrimSpace(line))
|
parts[i] = append(parts[i], strings.TrimSpace(line))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(parts[0])+len(parts[1]) == 0 {
|
if len(parts[0])+len(parts[1]) == 0 {
|
||||||
log.Info("no changes...")
|
log.Info("no changes...")
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
@ -261,10 +259,11 @@ func NixosRebuild(subcmd string, rest ...string) {
|
||||||
"--flake",
|
"--flake",
|
||||||
o.flake,
|
o.flake,
|
||||||
)
|
)
|
||||||
cmd.Args = append(cmd.Args, rest...)
|
cmd.Args = append(cmd.Args, "--log-format", "multiline")
|
||||||
if o.verbose {
|
if o.verbose {
|
||||||
cmd.Args = append(cmd.Args, "--print-build-logs")
|
cmd.Args = append(cmd.Args, "--print-build-logs")
|
||||||
}
|
}
|
||||||
|
cmd.Args = append(cmd.Args, rest...)
|
||||||
exitWithCommand(cmd)
|
exitWithCommand(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +275,6 @@ func NixBuild(nom bool, minimal bool, rest ...string) {
|
||||||
cmdName = "nix"
|
cmdName = "nix"
|
||||||
}
|
}
|
||||||
cmd := exec.Command(cmdName, "build")
|
cmd := exec.Command(cmdName, "build")
|
||||||
cmd.Args = append(cmd.Args, rest...)
|
|
||||||
if o.resetCache {
|
if o.resetCache {
|
||||||
cmd.Args = append(cmd.Args, "--narinfo-cache-positive-ttl", "0")
|
cmd.Args = append(cmd.Args, "--narinfo-cache-positive-ttl", "0")
|
||||||
}
|
}
|
||||||
|
@ -292,7 +290,8 @@ func NixBuild(nom bool, minimal bool, rest ...string) {
|
||||||
}
|
}
|
||||||
cmd.Args = append(cmd.Args, drvs...)
|
cmd.Args = append(cmd.Args, drvs...)
|
||||||
}
|
}
|
||||||
|
cmd.Args = append(cmd.Args, "--log-format", "multiline")
|
||||||
|
cmd.Args = append(cmd.Args, rest...)
|
||||||
exitWithCommand(cmd)
|
exitWithCommand(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue