Skip to content

[bug] strange path logic used when params.Flat = false #289

@jagprog5

Description

@jagprog5

Suppose I have a file in an artifactory repo:

repo_name/test_folder/tester.txt

This first way gives what I intent:

// repo_name/test_folder/tester.txt
remotePath := path.Join(item.Repo, item.Path, item.Name)
...
params.Flat = true
params.Target = filepath.Join(dst, item.Path, item.Name) // dst is just "./dst"
// puts the file in dst/test_folder/tester.txt
// this is the correct and desired behaviour

If I don't use flat then a strange folder is created and the file isn't downloaded:

...
params.Target = dst
// creates folder ./test_folder/dst

I assume that the above should retain the relative path in the repo and place it in the destination folder, just like the first example. But, instead it just breaks and created a weird folder. And the desired destination is empty. It's like the concatenation was flipped from what it should be (./test_folder/dst vs ./dst/test_folder)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions