Skip to content

Commit

Permalink
cleanup 'quick-hack' done in 2.3.9 - much better now
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Mar 29, 2020
1 parent 6b90258 commit 9824585
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 0 additions & 9 deletions src/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 0 additions & 9 deletions src/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 9824585

Please sign in to comment.