fix: check if platform-tool/rust/bin/rustc exists (#32350)
fix: check platform-tool/rust/bin/rustc exist before use
This commit is contained in:
parent
806d79a643
commit
c6574552e9
|
@ -166,6 +166,9 @@ fn get_base_rust_version(platform_tools_version: &str) -> String {
|
||||||
let target_path =
|
let target_path =
|
||||||
make_platform_tools_path_for_version("platform-tools", platform_tools_version);
|
make_platform_tools_path_for_version("platform-tools", platform_tools_version);
|
||||||
let rustc = target_path.join("rust").join("bin").join("rustc");
|
let rustc = target_path.join("rust").join("bin").join("rustc");
|
||||||
|
if !rustc.exists() {
|
||||||
|
return String::from("");
|
||||||
|
}
|
||||||
let args = vec!["--version"];
|
let args = vec!["--version"];
|
||||||
let output = spawn(&rustc, args, false);
|
let output = spawn(&rustc, args, false);
|
||||||
let rustc_re = Regex::new(r"(rustc [0-9]+\.[0-9]+\.[0-9]+).*").unwrap();
|
let rustc_re = Regex::new(r"(rustc [0-9]+\.[0-9]+\.[0-9]+).*").unwrap();
|
||||||
|
|
Loading…
Reference in New Issue