Skip to content

Commit

Permalink
Bump to v0.15.0-alpha.22 and update distant/ssh handlers to inject ex…
Browse files Browse the repository at this point in the history
…it code 0 when successful
  • Loading branch information
chipsenkbeil committed Oct 16, 2021
1 parent 1dc5b69 commit fefcc66
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "distant"
description = "Operate on a remote computer through file and process manipulation"
categories = ["command-line-utilities"]
keywords = ["cli"]
version = "0.15.0-alpha.21"
version = "0.15.0-alpha.22"
authors = ["Chip Senkbeil <[email protected]>"]
edition = "2018"
homepage = "https://github.com/chipsenkbeil/distant"
Expand All @@ -25,7 +25,7 @@ ssh2 = ["distant-ssh2"]

[dependencies]
derive_more = { version = "0.99.16", default-features = false, features = ["display", "from", "error", "is_variant"] }
distant-core = { version = "=0.15.0-alpha.21", path = "distant-core", features = ["structopt"] }
distant-core = { version = "=0.15.0-alpha.22", path = "distant-core", features = ["structopt"] }
flexi_logger = "0.18.0"
log = "0.4.14"
once_cell = "1.8.0"
Expand All @@ -37,7 +37,7 @@ strum = { version = "0.21.0", features = ["derive"] }
whoami = "1.1.2"

# Optional native SSH functionality
distant-ssh2 = { version = "=0.15.0-alpha.21", path = "distant-ssh2", optional = true }
distant-ssh2 = { version = "=0.15.0-alpha.22", path = "distant-ssh2", optional = true }

[target.'cfg(unix)'.dependencies]
fork = "0.1.18"
Expand Down
2 changes: 1 addition & 1 deletion distant-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "distant-core"
description = "Core library for distant, enabling operation on a remote computer through file and process manipulation"
categories = ["network-programming"]
keywords = ["api", "async"]
version = "0.15.0-alpha.21"
version = "0.15.0-alpha.22"
authors = ["Chip Senkbeil <[email protected]>"]
edition = "2018"
homepage = "https://github.com/chipsenkbeil/distant"
Expand Down
9 changes: 8 additions & 1 deletion distant-core/src/server/distant/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,14 @@ where
match status {
Ok(status) => {
let success = status.success();
let code = status.code();
let mut code = status.code();

// If we succeeded and have no exit code, automatically populate
// with success exit code
if success && code.is_none() {
code = Some(0);
}

let payload = vec![ResponseData::ProcDone { id, success, code }];
if !reply_2(payload).await {
error!(
Expand Down
6 changes: 3 additions & 3 deletions distant-lua/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "distant-lua"
description = "Lua bindings to the distant Rust crates"
categories = ["api-bindings", "network-programming"]
keywords = ["api", "async"]
version = "0.15.0-alpha.21"
version = "0.15.0-alpha.22"
authors = ["Chip Senkbeil <[email protected]>"]
edition = "2018"
homepage = "https://github.com/chipsenkbeil/distant"
Expand All @@ -24,8 +24,8 @@ luajit = ["mlua/luajit"]
vendored = ["mlua/vendored"]

[dependencies]
distant-core = { version = "=0.15.0-alpha.21", path = "../distant-core" }
distant-ssh2 = { version = "=0.15.0-alpha.21", features = ["serde"], path = "../distant-ssh2" }
distant-core = { version = "=0.15.0-alpha.22", path = "../distant-core" }
distant-ssh2 = { version = "=0.15.0-alpha.22", features = ["serde"], path = "../distant-ssh2" }
futures = "0.3.17"
log = "0.4.14"
mlua = { version = "0.6.6", features = ["async", "macros", "module", "serialize"] }
Expand Down
4 changes: 2 additions & 2 deletions distant-ssh2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "distant-ssh2"
description = "Library to enable native ssh-2 protocol for use with distant sessions"
categories = ["network-programming"]
version = "0.15.0-alpha.21"
version = "0.15.0-alpha.22"
authors = ["Chip Senkbeil <[email protected]>"]
edition = "2018"
homepage = "https://github.com/chipsenkbeil/distant"
Expand All @@ -12,7 +12,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
async-compat = "0.2.1"
distant-core = { version = "=0.15.0-alpha.21", path = "../distant-core" }
distant-core = { version = "=0.15.0-alpha.22", path = "../distant-core" }
futures = "0.3.16"
log = "0.4.14"
rand = { version = "0.8.4", features = ["getrandom"] }
Expand Down
2 changes: 1 addition & 1 deletion distant-ssh2/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ where
let payload = vec![ResponseData::ProcDone {
id,
success: !should_kill && success,
code: None,
code: if success { Some(0) } else { None },
}];

if !reply_2(payload).await {
Expand Down

0 comments on commit fefcc66

Please sign in to comment.