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

Ignore possible version directories that are hidden folders. #4758

Closed
wants to merge 6 commits into from

Conversation

philwrenn
Copy link
Contributor

I use a synchronization tool to sync my boxes between my laptop and desktop. This prevents me from having to download the same box version twice from vagrant cloud. My sync tool, like may others, creates a hidden folder to store sync related data and conflicted files. It would be nice if vagrant would not mistakenly identify the hidden folder as a version folder.

@@ -224,7 +224,7 @@ def all
# Otherwise, traverse the subdirectories and see what versions
# we have.
child.children(true).each do |versiondir|
next if !versiondir.directory?
next if !versiondir.directory? || versiondir.basename.to_s[0] == '.'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can make this a little clearer using start_with?:

versiondir.basename.start_with?(".")

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think we should move this check onto its own line:

next if !versiondir.directory?
next if versiondir.basename.start_with?(".") # Ignore hidden directories

@sethvargo
Copy link
Contributor

Hi @philwrenn

Thank you for the PR, and I am sorry it has taken a bit for us to get you a review. Overall this looks pretty good to me. I left a few comments in the PR - let me know what you think.

@philwrenn
Copy link
Contributor Author

I made the changes you suggested.

@philwrenn
Copy link
Contributor Author

@sethvargo I attempted made the changes you suggested, but I couldn't get build to complete.. Honestly I don't really work with ruby. I just ran into an issue and was lucky enough to get it working. If this isn't bugging anyone else you can just decline the request. This is no longer an issue for me.

@ghost ghost locked and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants