Skip to content

Commit 85ee0ed

Browse files
committed
fix: windows compile error.
1 parent 5a315ed commit 85ee0ed

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/utils/parse.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,17 @@ pub mod shell_command {
128128
#[async_trait]
129129
impl ChildUnify for SmolChild {
130130
async fn wait(mut self) -> AnyResult<ExitStatus> {
131-
Ok(ExitStatus::from_raw(
132-
self.status().await?.code().unwrap_or(1),
133-
))
131+
#[cfg(target_family = "windows")]
132+
{
133+
return Ok(ExitStatus::from_raw(
134+
self.status().await?.code().unwrap_or(1) as u32,
135+
));
136+
}
137+
138+
#[cfg(target_family = "unix")]
139+
return Ok(ExitStatus::from_raw(
140+
self.status().await?.code().unwrap_or(-1),
141+
));
134142
}
135143

136144
async fn wait_with_output(self) -> AnyResult<Output> {

0 commit comments

Comments
 (0)