don't lose error info on oizys dry

This commit is contained in:
Daylin Morgan 2024-05-06 15:33:40 -05:00
parent bb87af5136
commit 86bc2bf44f
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 4 additions and 2 deletions

View file

@ -11,7 +11,7 @@ var dryCmd = &cobra.Command{
Short: "poor man's nix flake check", Short: "poor man's nix flake check",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
oizys.CheckFlake(flake) oizys.CheckFlake(flake)
oizys.NixDryRun(oizys.Output(flake, host)) oizys.NixDryRun(flake, host)
}, },
} }

View file

@ -66,7 +66,8 @@ func ParseDryRunOutput(nixOutput string) {
ShowTable(columns, rows) ShowTable(columns, rows)
} }
func NixDryRun(path string) { func NixDryRun(flake string, host string) {
path := Output(flake, host)
cmd := exec.Command("nix", "build", path, "--dry-run") cmd := exec.Command("nix", "build", path, "--dry-run")
s := spinner.New( s := spinner.New(
spinner.CharSets[14], spinner.CharSets[14],
@ -77,6 +78,7 @@ func NixDryRun(path string) {
output, err := cmd.CombinedOutput() output, err := cmd.CombinedOutput()
s.Stop() s.Stop()
if err != nil { if err != nil {
fmt.Println(string(output))
log.Fatal(err) log.Fatal(err)
} }
ParseDryRunOutput(string(output)) ParseDryRunOutput(string(output))