Skip to content

Commit

Permalink
fix(shell): use serde untagged not flatten (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored May 21, 2024
1 parent db45dfa commit cb0a788
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/shell-execute-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shell": "patch"
---

Fix a regression introduce in the last release where The JS API `Command.execute()` returned malformed response.
3 changes: 1 addition & 2 deletions plugins/shell/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ fn prepare_cmd<R: Runtime>(
}

#[derive(Serialize)]
#[serde(untagged)]
enum Output {
String(String),
Raw(Vec<u8>),
Expand All @@ -179,9 +180,7 @@ enum Output {
pub struct ChildProcessReturn {
code: Option<i32>,
signal: Option<i32>,
#[serde(flatten)]
stdout: Output,
#[serde(flatten)]
stderr: Output,
}

Expand Down

0 comments on commit cb0a788

Please sign in to comment.