Compare commits

..

6 Commits

Author SHA1 Message Date
andy.boot 137bde1099 Fix: Try to stop panics on android.
Catch panics on thread initialization.
2022-08-26 17:12:39 +01:00
andy.boot 0d0206a5a5 Version: New version 2022-08-25 10:18:18 +01:00
andy.boot dfce0eec66 Fix: Warn if configuring threads fails
User reported this unwrap could fail, so log an error instead of using a
naked unwrap.
2022-08-25 08:59:15 +01:00
Kian-Meng Ang c148cd9044 Prettify md/yaml file
Resolved via `prettier --write .`
2022-08-24 08:59:30 +01:00
Kian-Meng Ang 2893f73f47 Fix typos
Found via `codespell -L crate`.
2022-08-24 08:55:00 +01:00
andy.boot 5103ebe0d8 Version: Increment version 2022-08-23 12:26:08 +01:00
6 changed files with 284 additions and 248 deletions
+35 -7
View File
@@ -81,13 +81,41 @@ jobs:
matrix: matrix:
job: job:
# { os, target, cargo-options, features, use-cross, toolchain } # { os, target, cargo-options, features, use-cross, toolchain }
- { os: ubuntu-latest , target: aarch64-unknown-linux-gnu , use-cross: use-cross } - {
- { os: ubuntu-latest , target: aarch64-unknown-linux-musl , use-cross: use-cross } os: ubuntu-latest,
- { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross: use-cross } target: aarch64-unknown-linux-gnu,
- { os: ubuntu-latest , target: i686-unknown-linux-gnu , use-cross: use-cross } use-cross: use-cross,
- { os: ubuntu-latest , target: i686-unknown-linux-musl , use-cross: use-cross } }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , use-cross: use-cross } - {
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , use-cross: use-cross } os: ubuntu-latest,
target: aarch64-unknown-linux-musl,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: arm-unknown-linux-gnueabihf,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: i686-unknown-linux-gnu,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: i686-unknown-linux-musl,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: x86_64-unknown-linux-gnu,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: x86_64-unknown-linux-musl,
use-cross: use-cross,
}
- { os: macos-latest, target: x86_64-apple-darwin } - { os: macos-latest, target: x86_64-apple-darwin }
- { os: windows-latest, target: i686-pc-windows-gnu } - { os: windows-latest, target: i686-pc-windows-gnu }
- { os: windows-latest, target: i686-pc-windows-msvc } - { os: windows-latest, target: i686-pc-windows-msvc }
Generated
+1 -1
View File
@@ -197,7 +197,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]] [[package]]
name = "du-dust" name = "du-dust"
version = "0.8.2" version = "0.8.3"
dependencies = [ dependencies = [
"ansi_term", "ansi_term",
"assert_cmd", "assert_cmd",
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "du-dust" name = "du-dust"
description = "A more intuitive version of du" description = "A more intuitive version of du"
version = "0.8.2" version = "0.8.3"
authors = ["bootandy <bootandy@gmail.com>", "nebkor <code@ardent.nebcorp.com>"] authors = ["bootandy <bootandy@gmail.com>", "nebkor <code@ardent.nebcorp.com>"]
edition = "2021" edition = "2021"
readme = "README.md" readme = "README.md"
+18 -18
View File
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/bootandy/dust.svg?branch=master)](https://travis-ci.org/bootandy/dust) [![Build Status](https://travis-ci.org/bootandy/dust.svg?branch=master)](https://travis-ci.org/bootandy/dust)
# Dust # Dust
@@ -10,35 +9,37 @@ du + rust = dust. Like du but more intuitive.
Because I want an easy way to see where my disk is being used. Because I want an easy way to see where my disk is being used.
# Demo # Demo
![Example](media/snap.png) ![Example](media/snap.png)
## Install ## Install
#### Cargo <a href="https://repology.org/project/du-dust/versions"><img src="https://repology.org/badge/vertical-allrepos/du-dust.svg" alt="Packaging status" align="right"></a> #### Cargo <a href="https://repology.org/project/du-dust/versions"><img src="https://repology.org/badge/vertical-allrepos/du-dust.svg" alt="Packaging status" align="right"></a>
* `cargo install du-dust` - `cargo install du-dust`
#### 🍺 Homebrew (Mac OS) #### 🍺 Homebrew (Mac OS)
* `brew install dust` - `brew install dust`
#### 🍺 Homebrew (Linux) #### 🍺 Homebrew (Linux)
* `brew tap tgotwig/linux-dust && brew install dust` - `brew tap tgotwig/linux-dust && brew install dust`
#### [Pacstall](https://github.com/pacstall/pacstall) (Debian/Ubuntu) #### [Pacstall](https://github.com/pacstall/pacstall) (Debian/Ubuntu)
* `pacstall -I dust-bin` - `pacstall -I dust-bin`
#### Windows: #### Windows:
* Windows GNU version - works
* Windows MSVC - requires: [VCRUNTIME140.dll](https://docs.microsoft.com/en-gb/cpp/windows/latest-supported-vc-redist?view=msvc-170) - Windows GNU version - works
- Windows MSVC - requires: [VCRUNTIME140.dll](https://docs.microsoft.com/en-gb/cpp/windows/latest-supported-vc-redist?view=msvc-170)
#### Download #### Download
* Download Linux/Mac binary from [Releases](https://github.com/bootandy/dust/releases) - Download Linux/Mac binary from [Releases](https://github.com/bootandy/dust/releases)
* unzip file: `tar -xvf _downloaded_file.tar.gz` - unzip file: `tar -xvf _downloaded_file.tar.gz`
* move file to executable path: `sudo mv dust /usr/local/bin/` - move file to executable path: `sudo mv dust /usr/local/bin/`
## Overview ## Overview
@@ -69,18 +70,17 @@ Usage: dust -f (Count files instead of diskspace)
Usage: dust -t (Group by filetype) Usage: dust -t (Group by filetype)
Usage: dust -z 10M (min-size, Only include files larger than 10M) Usage: dust -z 10M (min-size, Only include files larger than 10M)
Usage: dust -e regex (Only include files matching this regex (eg dust -e "\.png$" would match png files)) Usage: dust -e regex (Only include files matching this regex (eg dust -e "\.png$" would match png files))
Usage: dust -v regex (Exculde files matching this regex (eg dust -v "\.png$" would ignore png files)) Usage: dust -v regex (Exclude files matching this regex (eg dust -v "\.png$" would ignore png files))
``` ```
## Alternatives ## Alternatives
* [NCDU](https://dev.yorhel.nl/ncdu) - [NCDU](https://dev.yorhel.nl/ncdu)
* [dutree](https://github.com/nachoparker/dutree) - [dutree](https://github.com/nachoparker/dutree)
* [dua](https://github.com/Byron/dua-cli/) - [dua](https://github.com/Byron/dua-cli/)
* [pdu](https://github.com/KSXGitHub/parallel-disk-usage) - [pdu](https://github.com/KSXGitHub/parallel-disk-usage)
* [dirstat-rs](https://github.com/scullionw/dirstat-rs) - [dirstat-rs](https://github.com/scullionw/dirstat-rs)
* du -d 1 -h | sort -h - du -d 1 -h | sort -h
Note: Apparent-size is calculated slightly differently in dust to gdu. In dust each hard link is counted as using file_length space. In gdu only the first entry is counted. Note: Apparent-size is calculated slightly differently in dust to gdu. In dust each hard link is counted as using file_length space. In gdu only the first entry is counted.
+13 -5
View File
@@ -11,6 +11,7 @@ mod utils;
use crate::cli::build_cli; use crate::cli::build_cli;
use std::collections::HashSet; use std::collections::HashSet;
use std::panic;
use std::process; use std::process;
use self::display::draw_it; use self::display::draw_it;
@@ -19,6 +20,7 @@ use config::get_config;
use dir_walker::{walk_it, WalkData}; use dir_walker::{walk_it, WalkData};
use filter::get_biggest; use filter::get_biggest;
use filter_type::get_all_file_types; use filter_type::get_all_file_types;
use rayon::ThreadPoolBuildError;
use regex::Regex; use regex::Regex;
use std::cmp::max; use std::cmp::max;
use std::path::PathBuf; use std::path::PathBuf;
@@ -154,11 +156,10 @@ fn main() {
by_filecount, by_filecount,
ignore_hidden: config.get_ignore_hidden(&options), ignore_hidden: config.get_ignore_hidden(&options),
}; };
// Larger stack size to handle cases with lots of nested directories let pool = panic::catch_unwind(init_rayon);
rayon::ThreadPoolBuilder::new() if pool.is_err() {
.stack_size(usize::pow(1024, 3)) eprintln!("Warning: Could not configure threads {:?}", pool.err());
.build_global() }
.unwrap();
let iso = config.get_iso(&options); let iso = config.get_iso(&options);
let (top_level_nodes, has_errors) = walk_it(simplified_dirs, walk_data); let (top_level_nodes, has_errors) = walk_it(simplified_dirs, walk_data);
@@ -191,3 +192,10 @@ fn main() {
) )
} }
} }
fn init_rayon() -> Result<(), ThreadPoolBuildError> {
// Larger stack size to handle cases with lots of nested directories
rayon::ThreadPoolBuilder::new()
.stack_size(usize::pow(1024, 3))
.build_global()
}
+1 -1
View File
@@ -196,7 +196,7 @@ pub fn test_apparent_size() {
} }
fn apparent_size_output() -> Vec<String> { fn apparent_size_output() -> Vec<String> {
// The apparent directory sizes are too unpredictable and system dependant to try and match // The apparent directory sizes are too unpredictable and system dependent to try and match
let files = r#" let files = r#"
0B ┌── a_file 0B ┌── a_file
6B ├── hello_file 6B ├── hello_file