baked_file_system icon indicating copy to clipboard operation
baked_file_system copied to clipboard

dot files support?

Open sam0x17 opened this issue 5 years ago • 4 comments

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?

sam0x17 avatar Jul 07 '19 22:07 sam0x17

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.

straight-shoota avatar Sep 05 '19 15:09 straight-shoota

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.

MarcusE1W avatar Apr 20 '22 13:04 MarcusE1W

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 avatar Apr 20 '22 14:04 straight-shoota

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 https://github.com/mint-lang/mint/issues/544 is not caused by Dir.glob, but the following line where paths with hidden components are explicitly filtered out:

https://github.com/schovi/baked_file_system/blob/f086b45c52bac364e67b4b4c0b5698f2407215e2/src/loader/loader.cr#L23-L25

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.

straight-shoota avatar Apr 20 '22 16:04 straight-shoota