add --offline mode fallback to cargo fmt (#3813)
This commit is contained in:
parent
72e44c429b
commit
f4bc494153
@ -519,9 +519,16 @@ fn get_cargo_metadata(
|
||||
if let Some(manifest_path) = manifest_path {
|
||||
cmd.manifest_path(manifest_path);
|
||||
}
|
||||
|
||||
match cmd.exec() {
|
||||
Ok(metadata) => Ok(metadata),
|
||||
Err(error) => Err(io::Error::new(io::ErrorKind::Other, error.to_string())),
|
||||
Err(_) => {
|
||||
cmd.other_options(&[String::from("--offline")]);
|
||||
match cmd.exec() {
|
||||
Ok(metadata) => Ok(metadata),
|
||||
Err(error) => Err(io::Error::new(io::ErrorKind::Other, error.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user