Skip to content

Commit

Permalink
fix: Fixing rename check
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Apr 2, 2022
1 parent 9e2bfb1 commit bfe01de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/crud/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ func (a App) checkFile(ctx context.Context, pathname string, shouldExist bool) (
err = model.WrapInvalid(fmt.Errorf("`%s` already exist", pathname))
}
} else {
if absto.IsNotExist(err) && shouldExist {
err = model.WrapNotFound(fmt.Errorf("`%s` not found", pathname))
} else {
if !absto.IsNotExist(err) {
err = model.WrapInternal(err)
} else if shouldExist {
err = model.WrapNotFound(fmt.Errorf("`%s` not found", pathname))
}
}

Expand Down

0 comments on commit bfe01de

Please sign in to comment.