Skip to content

dst: file exists (affecting only directories) #1

@cedricium

Description

@cedricium

When attempting to copy files/dirs from the temporary directory to the destination and there already exists the same source directory in dst, the os.Rename call returns an ErrExist error ("file exists").

Note

This only occurs with directories; files are overwritten.

This is easily reproduced by running the same gitdl command twice containing at least one directory source:

$ ./gitdl cedricium/personal-site README.md posts public/blog-assets/coffee ~/Downloads/_gitdl/ # successful
$ ./gitdl cedricium/personal-site README.md posts public/blog-assets/coffee ~/Downloads/_gitdl/ # fails for dirs, README.md is overwritten
gitdl: rename /var/folders/r_/2r2qfg75683__01qq64k5vh80000gn/T/gitdl-4012728841/posts /Users/cedricamaya/Downloads/_gitdl/posts: file exists
gitdl: rename /var/folders/r_/2r2qfg75683__01qq64k5vh80000gn/T/gitdl-4012728841/public/blog-assets/coffee /Users/cedricamaya/Downloads/_gitdl/coffee: file exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions