Skip to content

Commit

Permalink
feat: Support passing show-trace to nix eval
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusramberg committed May 31, 2024
1 parent d944354 commit 47b0e65
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ var eval []byte

// We only care about these two, the remaining are passed through unharmed to helmfile
type Options struct {
File string `short:"f" long:"file" description:"helmfile.nix to use" default:"."`
Env string `short:"e" long:"environment" description:"Environment to deploy to" default:"dev"`
File string `short:"f" long:"file" description:"helmfile.nix to use" default:"."`
Env string `short:"e" long:"environment" description:"Environment to deploy to" default:"dev"`
ShowTrace []bool `long:"show-trace" description:"Enable stacktraces"`
}

var (
Expand Down Expand Up @@ -180,6 +181,9 @@ func renderHelmfile(base string, env string) ([]byte, error) {
"--impure",
"--expr", expr,
}
if len(opts.ShowTrace) > 0 {
cmd = append(cmd, "--show-trace")
}
eval := exec.Command("nix", cmd...)
l.Println("Running nix", strings.Join(cmd, " "))
eval.Stderr = os.Stderr
Expand Down

0 comments on commit 47b0e65

Please sign in to comment.