Skip to content

Commit

Permalink
Fixed object copy directory checking for multiple sources
Browse files Browse the repository at this point in the history
  • Loading branch information
turetske committed May 27, 2024
1 parent 2c11bab commit 527866b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/object_copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ func copyMain(cmd *cobra.Command, args []string) {
}

if len(source) > 1 {
if destStat, err := os.Stat(dest); err != nil && destStat.IsDir() {
if destStat, err := os.Stat(dest); err != nil {
log.Errorln("Destination does not exist")
os.Exit(1)
} else if !destStat.IsDir() {
log.Errorln("Destination is not a directory")
os.Exit(1)
}
Expand Down

0 comments on commit 527866b

Please sign in to comment.