mirror of
https://github.com/sharkdp/fd.git
synced 2024-09-27 20:41:30 +02:00
parent
2ea23c0000
commit
f7910c125d
@ -12,6 +12,7 @@ use std::error::Error;
|
|||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
#[cfg(target_family = "unix")]
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
use std::path::{Path, Component};
|
use std::path::{Path, Component};
|
||||||
use std::process;
|
use std::process;
|
||||||
@ -77,6 +78,7 @@ fn print_entry(base: &Path, entry: &Path, config: &FdOptions) {
|
|||||||
None => return
|
None => return
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(target_family = "unix")]
|
||||||
let is_executable = |p: &std::path::PathBuf| {
|
let is_executable = |p: &std::path::PathBuf| {
|
||||||
p.metadata()
|
p.metadata()
|
||||||
.ok()
|
.ok()
|
||||||
@ -84,6 +86,9 @@ fn print_entry(base: &Path, entry: &Path, config: &FdOptions) {
|
|||||||
.unwrap_or(false)
|
.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 {
|
if let Some(ref ls_colors) = config.ls_colors {
|
||||||
let mut component_path = base.to_path_buf();
|
let mut component_path = base.to_path_buf();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user