Skip to content

Commit

Permalink
Merge pull request #265 from epage/redirect
Browse files Browse the repository at this point in the history
fix(cli): Don't crash on stdin
  • Loading branch information
epage authored May 29, 2021
2 parents 8d50285 + d45e7cf commit bb4b3da
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
<!-- next-header -->
## [Unreleased] - ReleaseDate

#### Bug Fixes

- Fix crash when processing stdin (`-`)

## [1.0.2] - 2021-05-28

#### Bug Fixes
Expand Down
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ typed-arena = "2.0.1"

[dev-dependencies]
assert_fs = "1.0"
assert_cmd = "1.0"
predicates = "1.0"
criterion = "0.3"
maplit = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ fn walk_entry(
let explicit = entry.depth() == 0;
let (path, lookup_path) = if entry.is_stdin() {
let path = std::path::Path::new("-");
(path, path.to_owned())
(path, std::env::current_dir()?)
} else {
let path = entry.path();
(path, path.canonicalize()?)
Expand Down

0 comments on commit bb4b3da

Please sign in to comment.