Skip to content

Commit

Permalink
Merge #74
Browse files Browse the repository at this point in the history
74: v0.2.4 r=matklad a=matklad

bors r+

Co-authored-by: Alex Kladov <aleksey.kladov@gmail.com>
  • Loading branch information
bors[bot] and matklad committed Jul 10, 2023
2 parents 0af5ceb + 092a058 commit e165543
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.4

- Improve error message when a working directory for `cmd!` does not exist.

## 0.2.3

- Fix bug where `Cmd::run` would ignore specified stdin.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "xshell"
description = "Utilities for quick shell scripting in Rust"
categories = ["development-tools::build-utils", "filesystem"]
version = "0.2.3" # also update xshell-macros/Cargo.toml and CHANGELOG.md
version = "0.2.4" # also update xshell-macros/Cargo.toml and CHANGELOG.md
license = "MIT OR Apache-2.0"
repository = "https://github.com/matklad/xshell"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
Expand All @@ -14,7 +14,7 @@ exclude = [".github/", "bors.toml", "rustfmt.toml", "cbench", "mock_bin/"]
[workspace]

[dependencies]
xshell-macros = { version = "=0.2.3", path = "./xshell-macros" }
xshell-macros = { version = "=0.2.4", path = "./xshell-macros" }

[dev-dependencies]
anyhow = "1.0.56"
8 changes: 5 additions & 3 deletions tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,14 @@ fn nonexistent_current_directory() {
let sh = setup();
sh.change_dir("nonexistent");
let err = cmd!(sh, "ls").run().unwrap_err();
let message = err.to_string();
if cfg!(unix) {
assert!(err.to_string().starts_with("failed to get current directory"));
assert!(err.to_string().ends_with("No such file or directory (os error 2)"));
assert!(message.contains("nonexistent"), "{message}");
assert!(message.starts_with("failed to get current directory"));
assert!(message.ends_with("No such file or directory (os error 2)"));
} else {
assert_eq!(
err.to_string(),
message,
"io error when running command `ls`: The directory name is invalid. (os error 267)"
);
}
Expand Down
2 changes: 1 addition & 1 deletion xshell-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "xshell-macros"
description = "Private implementation detail of xshell crate"
version = "0.2.3"
version = "0.2.4"
license = "MIT OR Apache-2.0"
repository = "https://github.com/matklad/xshell"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
Expand Down

0 comments on commit e165543

Please sign in to comment.