Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #185 - location.Exists was checking if a list entry was a direc… #186

Merged
merged 1 commit into from
May 28, 2024

Conversation

funkyshu
Copy link
Member

…tory but it was was only checking the first entry.

…tory but it was was only checking the first entry.
@c2fo-cibot c2fo-cibot bot added the size/M Denotes a PR that changes 30-99 lines label May 28, 2024
for _, entry := range entries {
if entry.Name == path.Base(l.Path()) && entries[0].Type == _ftp.EntryTypeFolder {
for i := range entries {
if entries[i].Name == locBasename && entries[i].Type == _ftp.EntryTypeFolder {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entries[0] was the culprit here... only checking the first entry's type, resulting Exists returning false, then MoveToFile tried to create the dir (which already existed).

@funkyshu funkyshu merged commit 71131bb into main May 28, 2024
8 checks passed
@funkyshu funkyshu deleted the fix_loc_exists_bug_185 branch May 28, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants