mirror of
https://github.com/bootandy/dust.git
synced 2025-12-12 15:49:58 -08:00
Compare commits
3 Commits
f98b841d23
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62bf1e14de | ||
|
|
de2d748a88 | ||
|
|
509d51e872 |
582
Cargo.lock
generated
582
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
13
Cargo.toml
13
Cargo.toml
@@ -28,10 +28,10 @@ strip = true
|
||||
|
||||
[dependencies]
|
||||
ansi_term = "0.12"
|
||||
clap = { version = "4.4", features = ["derive"] }
|
||||
lscolors = "0.13"
|
||||
terminal_size = "0.2"
|
||||
unicode-width = "0.1"
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
lscolors = "0.21"
|
||||
terminal_size = "0.4"
|
||||
unicode-width = "0.2"
|
||||
rayon = "1"
|
||||
thousands = "0.2"
|
||||
stfu8 = "0.2"
|
||||
@@ -39,9 +39,8 @@ regex = "1"
|
||||
config-file = "0.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
directories = "4"
|
||||
sysinfo = "0.27"
|
||||
ctrlc = "3.4"
|
||||
sysinfo = "0.37"
|
||||
ctrlc = "3"
|
||||
chrono = "0.4"
|
||||
|
||||
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
|
||||
|
||||
@@ -244,7 +244,7 @@ fn convert_min_size(input: &str) -> Option<usize> {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_config_locations(base: &Path) -> Vec<PathBuf> {
|
||||
fn get_config_locations(base: PathBuf) -> Vec<PathBuf> {
|
||||
vec![
|
||||
base.join(".dust.toml"),
|
||||
base.join(".config").join("dust").join("config.toml"),
|
||||
@@ -267,8 +267,8 @@ pub fn get_config(conf_path: Option<&String>) -> Config {
|
||||
}
|
||||
}
|
||||
None => {
|
||||
if let Some(home) = directories::BaseDirs::new() {
|
||||
for path in get_config_locations(home.home_dir()) {
|
||||
if let Some(home) = std::env::home_dir() {
|
||||
for path in get_config_locations(home) {
|
||||
if path.exists()
|
||||
&& let Ok(config) = Config::from_config_file(&path)
|
||||
{
|
||||
|
||||
@@ -403,7 +403,7 @@ fn get_pretty_name(
|
||||
.ls_colors
|
||||
.style_for_path_with_metadata(&node.name, meta_result.as_ref().ok());
|
||||
let ansi_style = directory_color
|
||||
.map(Style::to_ansi_term_style)
|
||||
.map(Style::to_nu_ansi_term_style)
|
||||
.unwrap_or_default();
|
||||
let out = ansi_style.paint(name_and_padding);
|
||||
format!("{out}")
|
||||
|
||||
@@ -29,7 +29,7 @@ use std::panic;
|
||||
use std::process;
|
||||
use std::sync::Arc;
|
||||
use std::sync::Mutex;
|
||||
use sysinfo::{System, SystemExt};
|
||||
use sysinfo::System;
|
||||
use utils::canonicalize_absolute_path;
|
||||
|
||||
use self::display::draw_it;
|
||||
@@ -440,10 +440,10 @@ fn init_rayon(stack: &Option<usize>, threads: &Option<usize>) -> rayon::ThreadPo
|
||||
None
|
||||
} else {
|
||||
let large_stack = usize::pow(1024, 3);
|
||||
let mut s = System::new();
|
||||
s.refresh_memory();
|
||||
let mut sys = System::new_all();
|
||||
sys.refresh_memory();
|
||||
// Larger stack size if possible to handle cases with lots of nested directories
|
||||
let available = s.available_memory();
|
||||
let available = sys.available_memory();
|
||||
if available > (large_stack * threads.unwrap_or(1)).try_into().unwrap() {
|
||||
Some(large_stack)
|
||||
} else {
|
||||
|
||||
@@ -62,6 +62,8 @@ fn initialize() {
|
||||
fn run_cmd<T: AsRef<OsStr>>(command_args: &[T]) -> Output {
|
||||
initialize();
|
||||
let mut to_run = &mut Command::cargo_bin("dust").unwrap();
|
||||
// Hide progress bar
|
||||
to_run.arg("-P");
|
||||
for p in command_args {
|
||||
to_run = to_run.arg(p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user