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

dot files support? #34

Open
sam0x17 opened this issue Jul 7, 2019 · 5 comments
Open

dot files support? #34

sam0x17 opened this issue Jul 7, 2019 · 5 comments

Comments

@sam0x17
Copy link
Contributor

sam0x17 commented Jul 7, 2019

From what I can tell, this does not work with files begining with a dot, e.g. .gitignore. Is there a way to enable this?

@straight-shoota
Copy link
Collaborator

The globbing in bake_folder ignores hidden files. Adding an option to include them would be possible.
As a workaround, you can simply add those files manually using bake_file.

@MarcusE1W
Copy link

It seems not only hidden files, but also hidden folders are affected.
e.g. an installation in /home/user/.local/app did not work because of the dot folder.

@straight-shoota
Copy link
Collaborator

The fix should be simple. Dir.glob has a parameter match_hidden which allows to enable loading hidden files/folders.
It's just a question whether this should be enabled by default and/or if it should be configurable.
Maybe, for baked_file_system it actually makes most sense to always match hidden files, i.e. use match_hidden: true and it's not configurable.

@straight-shoota
Copy link
Collaborator

Oh, I just realized that it's not even Dir.glob at fault here. At least the issue with a root path containing a hidden folder name from mint-lang/mint#544 is not caused by Dir.glob, but the following line where paths with hidden components are explicitly filtered out:

files = Dir.glob(File.join(root_path, "**", "*"))
# Reject hidden entities and directories
.reject { |path| File.directory?(path) || !(path =~ /(\/\..+)/).nil? }

This obviously doesn't make any sense. It might just be a relic from older versions of Dir.glob which didn't support match_hidden. Even though I still don't think hidden files should be excluded. Using Dir.glob might not be the ideal solution here anyways. We really just need to walk the entire file tree starting at root_path in order to discover all file paths under it.

@ralsina
Copy link

ralsina commented Aug 25, 2024

This actually makes it impossible (or pretty hard) to package things using baked_file_system for Arch Linux because packages in AUR are built inside .cache so everything is "hidden" for baked_file_system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants