Skip to content
Snippets Groups Projects
Commit 9c106668a7a9 authored by steeve.chailloux's avatar steeve.chailloux
Browse files

add keep flag

parent 659de86e0598
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
type BuildCmd struct {
Args struct {
DryRun bool `short:"d" long:"dry-run" description:"if set only prints commands but do not run them"`
Keep bool `short:"k" long:"keep" descriptions:"Keep the temporary files"`
}
PositionnalArgs struct {
Namespace string `required:"yes" positional-arg-name:"namespace"`
......@@ -34,7 +35,7 @@
if err != nil {
return fmt.Errorf("failed to create temp dir: %w", err)
}
if !cmd.Args.DryRun {
if !cmd.Args.Keep {
defer func() {
if err := os.RemoveAll(tmpDir); err != nil {
Logger.Err(err).Str("tempdir", tmpDir).Msg("failed to remove temp dir")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment