-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add glob support for extra file permissions #2345
Conversation
…00-permission-globs
It should be deterministic, like last configured pattern wins. |
Actually, looks like Groovy maps are |
Oh actually I don't know, it was just a suggestion. I was thinking we apply all rules we find to a file, but it seems like we go looking for matches and apply the first one we find -- which actually makes sense. Should the pattern only match files? Can we accidentally end up making directories un-traversable? |
We still traverse over every file/directory, but some glob patterns could end up being completely skipped. e.g. this will set everything to 777:
But I think you can avoid this by just configuring the more specific patterns first. And again, if you configure permissions on files/directories without using a glob, those will override any permissions set using globs. |
so order doesn't matter for those? |
Correct. |
Actually, since we take the map from the gradle config and put it in a new map, we might not be maintaining order... will fix. |
Fixes #1200.
Can now use glob patterns when setting extra files permissions. Permissions configured with explicit paths will take priority over globs (e.g. if both
'/a/b/file': '777'
and'**/file': '444'
are configured,/a/b/file
will have777
permissions, and all other files namedfile
will have444
permissions).If a file matches multiple globs (e.g. if there's a file
/a/b/file
, and permissions are configured for both/a/b/*
and**/file
),behavior is undefined at the momentfirst configured match wins.