summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--src/aggregate.rs9
-rw-r--r--src/main.rs8
-rw-r--r--src/traverse.rs9
4 files changed, 11 insertions, 18 deletions
diff --git a/README.md b/README.md
index 7d5cef1..dc72b1e 100644
--- a/README.md
+++ b/README.md
@@ -96,6 +96,9 @@ Thanks to [jwalk][jwalk], all there was left to do is to write a command-line in
### Limitations
+* Does not show symbolic links at all if no path is provided when invoking `dua`
+ * in an effort to skip symbolic links, for now there are pruned and are not used as a root. Symbolic links will be shown if they
+ are not a traversal root, but will not be followed.
* Interactive mode only looks good in dark terminals (see [this issue](https://github.com/Byron/dua-cli/issues/13))
* _easy fix_: file names in main window are not truncated if too large. They are cut off on the right.
* There are plenty of examples in `tests/fixtures` which don't render correctly in interactive mode.
diff --git a/src/aggregate.rs b/src/aggregate.rs
index 538950a..b04fa83 100644
--- a/src/aggregate.rs
+++ b/src/aggregate.rs
@@ -23,16 +23,7 @@ pub fn aggregate(
let mut aggregates = Vec::new();
let mut inodes = InodeFilter::default();
let paths: Vec<_> = paths.into_iter().collect();
- let input_len = paths.len();
for path in paths.into_iter() {
- // For now, bluntly ignore symlinks that are on the top-level, and there are more roots to follow
- if input_len > 1 {
- if let Ok(meta) = path.as_ref().symlink_metadata() {
- if meta.file_type().is_symlink() {
- continue;
- }
- }
- }
num_roots += 1;
let mut num_bytes = 0u64;
let mut num_errors = 0u64;
diff --git a/src/main.rs b/src/main.rs
index cfe6228..91cb79b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -102,6 +102,14 @@ fn cwd_dirlist() -> Result<Vec<PathBuf>, io::Error> {
e.ok()
.and_then(|e| e.path().strip_prefix(".").ok().map(ToOwned::to_owned))
})
+ .filter(|p| {
+ if let Ok(meta) = p.symlink_metadata() {
+ if meta.file_type().is_symlink() {
+ return false;
+ }
+ };
+ true
+ })
.collect();
v.sort();
Ok(v)
diff --git a/src/traverse.rs b/src/traverse.rs
index c971bd1..ab4eff9 100644
--- a/src/traverse.rs
+++ b/src/traverse.rs
@@ -78,16 +78,7 @@ impl Traversal {
// Also means that we will spin up a bunch of threads per root path, instead of reusing them.
walk_options.threads = num_cpus::get();
}
- let input_len = input.len();
for path in input.into_iter() {
- // For now, bluntly ignore symlinks that are on the top-level, and there are more roots to follow
- if input_len > 1 {
- if let Ok(meta) = path.symlink_metadata() {
- if meta.file_type().is_symlink() {
- continue;
- }
- }
- }
let mut last_seen_eid = 0;
for (eid, entry) in walk_options
.iter_from_path(path.as_ref())