File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ use crate::sources::source::QueryKind;
2121use crate :: sources:: source:: Source ;
2222use crate :: util:: GlobalContext ;
2323use crate :: util:: cache_lock:: CacheLockMode ;
24+ use crate :: util:: context:: ConfigRelativePath ;
2425use crate :: util:: errors:: CargoResult ;
2526use crate :: util:: { FileLock , Filesystem } ;
2627
@@ -545,11 +546,14 @@ impl InstallInfo {
545546
546547/// Determines the root directory where installation is done.
547548pub fn resolve_root ( flag : Option < & str > , gctx : & GlobalContext ) -> CargoResult < Filesystem > {
548- let config_root = gctx. get_path ( "install.root" ) ?;
549+ let config_root = gctx
550+ . get :: < Option < ConfigRelativePath > > ( "install.root" ) ?
551+ . map ( |p| p. resolve_program ( gctx) ) ;
552+
549553 Ok ( flag
550554 . map ( PathBuf :: from)
551555 . or_else ( || gctx. get_env_os ( "CARGO_INSTALL_ROOT" ) . map ( PathBuf :: from) )
552- . or_else ( move || config_root. map ( |v| v . val ) )
556+ . or_else ( || config_root)
553557 . map ( Filesystem :: new)
554558 . unwrap_or_else ( || gctx. home ( ) . clone ( ) ) )
555559}
You can’t perform that action at this time.
0 commit comments