mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
fs::create_dir_all(&install_path)
in main.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
346bb8ee67
commit
28aeae938e
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
use std::{
|
use std::{
|
||||||
ffi::OsString,
|
ffi::OsString,
|
||||||
|
fs,
|
||||||
mem::take,
|
mem::take,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process::{ExitCode, Termination},
|
process::{ExitCode, Termination},
|
||||||
|
@ -295,6 +296,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
|
||||||
error!("No viable install path found of specified, try `--install-path`");
|
error!("No viable install path found of specified, try `--install-path`");
|
||||||
miette!("No install path found or specified")
|
miette!("No install path found or specified")
|
||||||
})?;
|
})?;
|
||||||
|
fs::create_dir_all(&install_path).map_err(BinstallError::Io)?;
|
||||||
debug!("Using install path: {}", install_path.display());
|
debug!("Using install path: {}", install_path.display());
|
||||||
|
|
||||||
// Create a temporary directory for downloads etc.
|
// Create a temporary directory for downloads etc.
|
||||||
|
@ -393,6 +395,10 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
|
||||||
|
|
||||||
block_in_place(|| {
|
block_in_place(|| {
|
||||||
if !custom_install_path {
|
if !custom_install_path {
|
||||||
|
// If using standardised install path,
|
||||||
|
// then create_dir_all(&install_path) would also
|
||||||
|
// create .cargo.
|
||||||
|
|
||||||
debug!("Writing .crates.toml");
|
debug!("Writing .crates.toml");
|
||||||
metafiles::v1::CratesToml::append(metadata_vec.iter())?;
|
metafiles::v1::CratesToml::append(metadata_vec.iter())?;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue