Fix updating metafiles: Skip on custom install path

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-22 22:59:02 +10:00
parent d21dde4889
commit 7bdc720a9a
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -241,6 +241,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
let desired_targets = get_desired_targets(&opts.targets);
// Compute install directory
let custom_install_path = opts.install_path.is_some();
let install_path: Arc<Path> = Arc::from(
get_install_path(opts.install_path.as_deref()).ok_or_else(|| {
error!("No viable install path found of specified, try `--install-path`");
@ -338,6 +339,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
}
block_in_place(|| {
if !custom_install_path {
debug!("Writing .crates.toml");
metafiles::v1::CratesToml::append(
metadata_vec
@ -359,6 +361,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
},
)
}))?;
}
if opts.no_cleanup {
// Consume temp_dir without removing it from fs.