Skip to content

Commit bb4b3da

Browse files
authored
Merge pull request #265 from epage/redirect
fix(cli): Don't crash on stdin
2 parents 8d50285 + d45e7cf commit bb4b3da

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
<!-- next-header -->
88
## [Unreleased] - ReleaseDate
99

10+
#### Bug Fixes
11+
12+
- Fix crash when processing stdin (`-`)
13+
1014
## [1.0.2] - 2021-05-28
1115

1216
#### Bug Fixes

Cargo.lock

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ typed-arena = "2.0.1"
8383

8484
[dev-dependencies]
8585
assert_fs = "1.0"
86+
assert_cmd = "1.0"
8687
predicates = "1.0"
8788
criterion = "0.3"
8889
maplit = "1.0"

src/file.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ fn walk_entry(
600600
let explicit = entry.depth() == 0;
601601
let (path, lookup_path) = if entry.is_stdin() {
602602
let path = std::path::Path::new("-");
603-
(path, path.to_owned())
603+
(path, std::env::current_dir()?)
604604
} else {
605605
let path = entry.path();
606606
(path, path.canonicalize()?)

0 commit comments

Comments
 (0)