We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b34b677 commit 3e96036Copy full SHA for 3e96036
1 file changed
crates/vite_command/src/lib.rs
@@ -340,14 +340,12 @@ mod tests {
340
341
#[cfg(unix)]
342
let (bin_path, args) = {
343
- use std::os::unix::fs::PermissionsExt;
344
-
345
- let script_path = temp_dir_path.join("test-bin");
346
- std::fs::write(&script_path, "#!/bin/sh\nexit 0\n").unwrap();
347
- let mut permissions = std::fs::metadata(&script_path).unwrap().permissions();
348
- permissions.set_mode(0o755);
349
- std::fs::set_permissions(&script_path, permissions).unwrap();
350
- (script_path.as_path().display().to_string(), Vec::<&str>::new())
+ let true_path = if std::path::Path::new("/bin/true").exists() {
+ "/bin/true"
+ } else {
+ "/usr/bin/true"
+ };
+ (true_path.to_string(), Vec::<&str>::new())
351
};
352
353
#[cfg(not(unix))]
0 commit comments