diff --git a/cmd/subcmd/get.go b/cmd/subcmd/get.go index 681dd33..7ea44a6 100644 --- a/cmd/subcmd/get.go +++ b/cmd/subcmd/get.go @@ -137,6 +137,8 @@ func getOne(transferManager *commons.ParallelTransferManager, filesystem *irodsc } if sourceEntry.Type == irodsclient_fs.FileEntry { + logger.Debugf("downloading a data object %s to %s", sourcePath, targetPath) + targetFilePath := commons.EnsureTargetLocalFilePath(sourcePath, targetPath) targetStat, err := os.Stat(targetFilePath) diff --git a/commons/path.go b/commons/path.go index ac4dde7..7acc0aa 100644 --- a/commons/path.go +++ b/commons/path.go @@ -37,14 +37,12 @@ func MakeIRODSPath(cwd string, homedir string, zone string, irodsPath string) st } func MakeLocalPath(localPath string) string { - if strings.HasPrefix(localPath, string(os.PathSeparator)) { + absLocalPath, err := filepath.Abs(localPath) + if err != nil { return filepath.Clean(localPath) } - wd, _ := os.Getwd() - - newPath := filepath.Join(wd, localPath) - return filepath.Clean(newPath) + return filepath.Clean(absLocalPath) } func EnsureTargetIRODSFilePath(filesystem *irodsclient_fs.FileSystem, source string, target string) string {