-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
Fix showing every file as executable on Windows #769
Conversation
I like the idea of having predefined file extensions being marked as executable. I don't think we should have an option to configure it though. If they want to add more file extensions to be marked as green, one can always control it with LS_COLORS(or PR to upstream if it is really common). Could you rework it so that we don't have a new cli flag or config option? |
`exe`, `msi`, `bat` and `ps1` are marked as executable.
I dropped the configuration option and cli flag. I was not really happy with them either, it felt like a little too much, but i haven't thought of just using |
With this in place, we could probably also revisit fetching ACL permission only on demand, since we don't use any other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Add a test for verifying this behavior on windows and we should be good to go. :D
src/meta/permissions.rs
Outdated
@@ -127,6 +127,7 @@ impl Permissions { | |||
ColoredString::new(Colors::default_style(), res) | |||
} | |||
|
|||
#[cfg_attr(windows, allow(dead_code))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, we can change this to #[cfg(not(windows))]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 😇
Codecov Report
@@ Coverage Diff @@
## master #769 +/- ##
==========================================
- Coverage 86.68% 86.60% -0.08%
==========================================
Files 44 44
Lines 4332 4336 +4
==========================================
Hits 3755 3755
- Misses 577 581 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This PR determines the executable state of a file on Windows using the file extension instead of permissions.
This fixes that every regular file was marked executable (green).
added--exec-ext <ext>
to change mark extensions as executable on the flyaddedexecutable-extensions
config to modify them more permantlyLS_COLORS
can be used to customize (other) extentionscli flags and config file options will be mergedexe
,msi
,cmd
andps1
will be marked as executable on windowsFixes #712
TODO
cargo fmt