mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
contracts-fixtures: Do not assume that rustup is installed (#2586)
The build script was assuming that `rustup` is installed, which breaks the build on systems that do not use `rustup`. This pull request just fixes it by not panicking on the call to `rustup`.
This commit is contained in:
@@ -147,9 +147,7 @@ fn invoke_cargo_fmt<'a>(
|
|||||||
if !Command::new("rustup")
|
if !Command::new("rustup")
|
||||||
.args(&["run", "nightly", "rustfmt", "--version"])
|
.args(&["run", "nightly", "rustfmt", "--version"])
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to execute process")
|
.map_or(false, |o| o.status.success())
|
||||||
.status
|
|
||||||
.success()
|
|
||||||
{
|
{
|
||||||
return Ok(())
|
return Ok(())
|
||||||
}
|
}
|
||||||
@@ -169,10 +167,12 @@ fn invoke_cargo_fmt<'a>(
|
|||||||
let stderr = String::from_utf8_lossy(&fmt_res.stderr);
|
let stderr = String::from_utf8_lossy(&fmt_res.stderr);
|
||||||
eprintln!("{}\n{}", stdout, stderr);
|
eprintln!("{}\n{}", stdout, stderr);
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Fixtures files are not formatted.\nPlease run `rustup run nightly rustfmt --config-path {} {}/*.rs`",
|
"Fixtures files are not formatted.\n
|
||||||
|
Please run `rustup run nightly rustfmt --config-path {} {}/*.rs`",
|
||||||
config_path.display(),
|
config_path.display(),
|
||||||
contract_dir.display()
|
contract_dir.display()
|
||||||
);
|
);
|
||||||
|
|
||||||
anyhow::bail!("Fixtures files are not formatted")
|
anyhow::bail!("Fixtures files are not formatted")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user