Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 567b9dc

Browse files
authored
fix acorn run --update behavior to allow --name flag (#1445)
Signed-off-by: Joshua Silverio <joshua@acorn.io>
1 parent dc73d55 commit 567b9dc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/cli/run.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ func (s *Run) Run(cmd *cobra.Command, args []string) error {
271271
if s.Interactive {
272272
return fmt.Errorf("cannot use --update/-u or --replace/-r with --dev/-i")
273273
}
274-
return updateHelper(cmd, args, s, c, isDir, cwd)
274+
//if app does not exist but --update/--replace flag is used create app instead
275+
if existingApp != nil {
276+
return updateHelper(cmd, args, s, c, isDir, cwd)
277+
}
275278
}
276279

277280
if s.Interactive {

pkg/cli/run_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,6 @@ func TestRun(t *testing.T) {
285285
Spec: apiv1.InfoSpec{},
286286
},
287287
}, nil)
288-
f.EXPECT().ImageDetails(gomock.Any(), gomock.Any(), gomock.Any()).Return(
289-
nil, fmt.Errorf("error: app image-dne does not exist"))
290288
},
291289
},
292290
{

0 commit comments

Comments
 (0)