Skip to content

Commit

Permalink
workspace target validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridai Govinda Pombo committed Jun 2, 2020
1 parent 4cceb0b commit 0c55aba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func (w *workspaceListCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...inte
}
}


fmt.Printf(" * %s (%s)", c.Container.Name, status)
}
}
Expand Down Expand Up @@ -277,6 +276,11 @@ func (*workspaceTargetCmd) Usage() string {
func (w *workspaceTargetCmd) SetFlags(f *flag.FlagSet) {}

func (w *workspaceTargetCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
if len(f.Args()) == 0 {
log.Errorf("Needs a target definition")
return subcommands.ExitFailure
}

packageName := f.Args()[0]

log.Infof("Setting %s as target", packageName)
Expand All @@ -291,6 +295,7 @@ func (w *workspaceTargetCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...
err = workspace.Save()

if err != nil {
log.Errorf("Unable to save target definition to the workspace: %v", err)
return subcommands.ExitFailure
}

Expand Down

0 comments on commit 0c55aba

Please sign in to comment.