Skip to content

Commit

Permalink
remove extra local src URI
Browse files Browse the repository at this point in the history
  • Loading branch information
nopcoder committed Feb 9, 2025
1 parent 5051363 commit a1ee81d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions cmd/lakectl/cmd/fs_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,20 @@ var fsDownloadCmd = &cobra.Command{
downloader.PartSize = downloadPartSize

if !recursive {
src := uri.URI{
Repository: remote.Repository,
Ref: remote.Ref,
Path: remote.Path,
}
// if dest is a directory, add the file name
if s, _ := os.Stat(dest); s != nil && s.IsDir() {
dest += uri.PathSeparator
}
remotePath := src.GetPath()
remotePath := remote.GetPath()
if remotePath != "" && strings.HasSuffix(dest, uri.PathSeparator) {
dest += filepath.Base(remotePath)
}

err := downloader.Download(ctx, src, dest, nil)
err := downloader.Download(ctx, *remote, dest, nil)
if err != nil {
DieErr(err)
}
fmt.Printf("download: %s to %s\n", src.String(), dest)
fmt.Printf("download: %s to %s\n", remote.String(), dest)
return
}

Expand Down

0 comments on commit a1ee81d

Please sign in to comment.