Skip to content

Commit 1961236

Browse files
committed
Directly build tokio command instead of converting
1 parent 406d028 commit 1961236

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

crates/repository/src/cargo.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use std::{
44
ffi::{OsStr, OsString},
55
fmt::{Display, Formatter},
66
path::Path,
7-
process::Command,
87
};
98

109
use color_eyre::{
1110
eyre::{bail, Context, ContextCompat},
1211
Result,
1312
};
1413
use pathdiff::diff_paths;
14+
use tokio::process::Command;
1515

1616
use crate::{data_home::get_data_home, sdk::download_and_install};
1717

@@ -73,14 +73,13 @@ impl Cargo {
7373
Host::Remote => {
7474
let mut command =
7575
Command::new(repository_root.as_ref().join("scripts/remoteWorkspace"));
76-
command
76+
77+
let status = command
7778
.arg("pepsi")
7879
.arg("sdk")
7980
.arg("install")
8081
.arg("--version")
81-
.arg(version);
82-
83-
let status = tokio::process::Command::from(command)
82+
.arg(version)
8483
.status()
8584
.await
8685
.wrap_err("failed to run pepsi")?;

tools/pepsi/src/cargo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ pub async fn cargo<CargoArguments: Args + CargoCommand>(
112112

113113
arguments.cargo.apply(&mut cargo);
114114

115-
let cargo_command = cargo
115+
let mut cargo_command = cargo
116116
.command(&repository_root, compiler_artifacts)
117117
.wrap_err("failed to create cargo command")?;
118118

119119
debug!("Running `{cargo_command:?}`");
120120

121-
let status = tokio::process::Command::from(cargo_command)
121+
let status = cargo_command
122122
.status()
123123
.await
124124
.wrap_err("failed to run cargo")?;

0 commit comments

Comments
 (0)