Skip to content

Commit

Permalink
Merge pull request PelicanPlatform#1337 from turetske/object-copy-dir…
Browse files Browse the repository at this point in the history
…ectory-check

Fixed `object copy` directory checking for multiple sources
  • Loading branch information
joereuss12 authored May 28, 2024
2 parents 2c11bab + 527866b commit c526478
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 c526478

Please sign in to comment.