Skip to content

Commit

Permalink
fix(cli): Don't crash on stdin
Browse files Browse the repository at this point in the history
Fixes #264
  • Loading branch information
Ed Page committed May 29, 2021
1 parent 7d1fbe5 commit d45e7cf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
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
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
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 d45e7cf

Please sign in to comment.