summaryrefslogtreecommitdiffstats
path: root/src/tools/tidy/src/bins.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
commit17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch)
tree3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /src/tools/tidy/src/bins.rs
parentAdding upstream version 1.64.0+dfsg1. (diff)
downloadrustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.tar.xz
rustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.zip
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/tidy/src/bins.rs')
-rw-r--r--src/tools/tidy/src/bins.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tools/tidy/src/bins.rs b/src/tools/tidy/src/bins.rs
index 9615c4db6..30903f56d 100644
--- a/src/tools/tidy/src/bins.rs
+++ b/src/tools/tidy/src/bins.rs
@@ -96,7 +96,9 @@ mod os_impl {
#[cfg(unix)]
pub fn check(path: &Path, bad: &mut bool) {
- const ALLOWED: &[&str] = &["configure"];
+ use std::ffi::OsStr;
+
+ const ALLOWED: &[&str] = &["configure", "x"];
crate::walk_no_read(
path,
@@ -117,9 +119,9 @@ mod os_impl {
},
&mut |entry| {
let file = entry.path();
- let filename = file.file_name().unwrap().to_string_lossy();
- let extensions = [".py", ".sh"];
- if extensions.iter().any(|e| filename.ends_with(e)) {
+ let extension = file.extension();
+ let scripts = ["py", "sh", "ps1"];
+ if scripts.into_iter().any(|e| extension == Some(OsStr::new(e))) {
return;
}