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",
Run: func(cmd *cobra.Command, args []string) {
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)
}
func NixDryRun(path string) {
func NixDryRun(flake string, host string) {
path := Output(flake, host)
cmd := exec.Command("nix", "build", path, "--dry-run")
s := spinner.New(
spinner.CharSets[14],
@ -77,6 +78,7 @@ func NixDryRun(path string) {
output, err := cmd.CombinedOutput()
s.Stop()
if err != nil {
fmt.Println(string(output))
log.Fatal(err)
}
ParseDryRunOutput(string(output))