Fix custom_install_path detection

Installing to `CARGO_INSTALL_ROOT` or the local executable dir should be
considered a custom installation path.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-23 18:33:30 +10:00
parent 7bdc720a9a
commit 79476e490b
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
2 changed files with 14 additions and 13 deletions

View file

@ -241,13 +241,11 @@ 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`");
miette!("No install path found or specified")
})?,
);
let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref());
let install_path: Arc<Path> = Arc::from(install_path.ok_or_else(|| {
error!("No viable install path found of specified, try `--install-path`");
miette!("No install path found or specified")
})?);
debug!("Using install path: {}", install_path.display());
// Create a temporary directory for downloads etc.