mirror of
https://github.com/sharkdp/fd
synced 2024-11-02 09:09:17 +00:00
parent
2ea23c0000
commit
f7910c125d
1 changed files with 5 additions and 0 deletions
|
@ -12,6 +12,7 @@ use std::error::Error;
|
|||
use std::ffi::OsStr;
|
||||
use std::fs;
|
||||
use std::io::Write;
|
||||
#[cfg(target_family = "unix")]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use std::path::{Path, Component};
|
||||
use std::process;
|
||||
|
@ -77,6 +78,7 @@ fn print_entry(base: &Path, entry: &Path, config: &FdOptions) {
|
|||
None => return
|
||||
};
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
let is_executable = |p: &std::path::PathBuf| {
|
||||
p.metadata()
|
||||
.ok()
|
||||
|
@ -84,6 +86,9 @@ fn print_entry(base: &Path, entry: &Path, config: &FdOptions) {
|
|||
.unwrap_or(false)
|
||||
};
|
||||
|
||||
#[cfg(not(target_family = "unix"))]
|
||||
let is_executable = |p: &std::path::PathBuf| {false};
|
||||
|
||||
if let Some(ref ls_colors) = config.ls_colors {
|
||||
let mut component_path = base.to_path_buf();
|
||||
|
||||
|
|
Loading…
Reference in a new issue