Skip to content

Commit

Permalink
fix non-create mode of add components (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandelsoft authored Dec 21, 2022
1 parent 957d42a commit a34a1f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmds/ocm/commands/ocmcmds/components/add/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ func (o *Command) Run() error {
if err != nil {
return errors.Wrapf(err, "cannot remove old %q", fp)
}
o.Create = true
}
}

var repo ocm.Repository
if o.Create {
repo, err = ctf.Create(o.Context.OCMContext(), accessobj.ACC_CREATE, fp, mode, o.Handler, fs)
} else {
repo, err = ctf.Open(o.Context.OCMContext(), accessobj.ACC_CREATE, fp, mode, fs)
repo, err = ctf.Open(o.Context.OCMContext(), accessobj.ACC_WRITABLE, fp, mode, fs)
}

if err == nil {
Expand Down

0 comments on commit a34a1f8

Please sign in to comment.