Hide dotfiles from instance content scanning#5999
Open
acorsicanfrog wants to merge 5 commits intomodrinth:mainfrom
Open
Hide dotfiles from instance content scanning#5999acorsicanfrog wants to merge 5 commits intomodrinth:mainfrom
acorsicanfrog wants to merge 5 commits intomodrinth:mainfrom
Conversation
Prevent hidden files such as .DS_Store from being treated as valid instance content. This updates the profile scanning logic in [packages/app-lib/src/state/profiles.rs](/Users/froggy/Downloads/code-main/packages/app-lib/src/state/profiles.rs#L420) to ignore basenames that start with '.', and applies that filter consistently in both scan paths. Signed-off-by: Corsican Frog <49497194+acorsicanfrog@users.noreply.github.com>
Member
Pull request changelogAppAddedChangedDeprecatedRemovedFixed
SecurityWebsiteAddedChangedDeprecatedRemovedFixedSecurityHostingAddedChangedDeprecatedRemovedFixedSecurity |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates profile content scanning in packages/app-lib so hidden dotfiles are no longer treated as installed instance content. It centralizes the ignore logic to keep the two scan paths aligned and fixes the false-positive content entries shown for files like .DS_Store.
Changes:
- Added a shared
should_ignore_project_filehelper inprofiles.rs. - Extended scan filtering to ignore basenames starting with
.. - Reused the helper in both profile scan paths to keep behavior consistent.
fetchfern
requested changes
May 5, 2026
Comment on lines
+420
to
+428
| fn should_ignore_project_file( | ||
| project_type: ProjectType, | ||
| file_name: &str, | ||
| ) -> bool { | ||
| file_name.starts_with('.') | ||
| || (project_type == ProjectType::ShaderPack | ||
| && file_name.ends_with(".txt")) | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
Would implement as a whitelist rather than blacklist; only process .jar and .zip and other formats I'm forgetting if any
Author
There was a problem hiding this comment.
OK done, is it better now?
Only scan supported content archives into instance content. Accept .jar files for mods and .zip files for datapacks, resourcepacks, and shaderpacks, after trimming the .disabled suffix. This prevents .DS_Store and other unsupported files from appearing in the Content tab. Signed-off-by: Corsican Frog <49497194+acorsicanfrog@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevent hidden files such as .DS_Store from being treated as valid instance content.
This updates the profile scanning logic in packages/app-lib/src/state/profiles.rs to ignore basenames that start with '.', and applies that filter consistently in both scan paths.
Fixing this: