Skip to content

Commit

Permalink
Don't try to print dirs
Browse files Browse the repository at this point in the history
Fixes #1135
  • Loading branch information
Morganamilo committed Mar 13, 2024
1 parent 8b486c5 commit 057706b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,9 @@ fn print_dir(
let _ = write!(stdin, "{}", c.bold.paint(s));
continue;
}
if file.file_type()?.is_dir() {
continue;
}

let _ = writeln!(stdin, "{}", c.bold.paint(file.path().display().to_string()));
if bat {
Expand All @@ -1630,14 +1633,14 @@ fn print_dir(
})?;
let _ = stdin.write_all(&output.stdout);
} else {
let mut pkgbbuild = OpenOptions::new()
let mut pkgfile = OpenOptions::new()
.read(true)
.open(file.path())
.with_context(|| {
tr!("failed to open: {}", file.path().display().to_string())
})?;
buf.clear();
pkgbbuild.read_to_end(buf)?;
pkgfile.read_to_end(buf)?;

let _ = match std::str::from_utf8(buf) {
Ok(_) => stdin.write_all(buf),
Expand Down

0 comments on commit 057706b

Please sign in to comment.