mirror of
https://github.com/esp-rs/espup.git
synced 2025-09-27 04:40:27 +00:00
Create $RUSTUP_HOME/tmp if needed (#365)
* fix: Create $RUSTUP_HOME/tmp if needed * style: Simplify create_dir_all error * docs: Update CHANGELOG.md * perf: Fix Windows includes
This commit is contained in:
parent
09b94cd9e0
commit
107de282ce
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
- Create $RUSTUP_HOME/tmp if needed (#365)
|
||||
- Complete Xtensa Rust versions when provided one is incompleted (#366)
|
||||
|
||||
### Removed
|
||||
|
@ -65,9 +65,8 @@ pub async fn download_file(
|
||||
emoji::WRENCH,
|
||||
output_directory
|
||||
);
|
||||
if create_dir_all(output_directory).is_err() {
|
||||
return Err(Error::CreateDirectory(output_directory.to_string()));
|
||||
}
|
||||
create_dir_all(output_directory)
|
||||
.map_err(|_| Error::CreateDirectory(output_directory.to_string()))?;
|
||||
}
|
||||
info!(
|
||||
"{} Downloading file '{}' from '{}'",
|
||||
|
@ -17,6 +17,8 @@ use directories::BaseDirs;
|
||||
use log::{debug, info, warn};
|
||||
use miette::Result;
|
||||
use regex::Regex;
|
||||
#[cfg(unix)]
|
||||
use std::fs::create_dir_all;
|
||||
use std::{
|
||||
env,
|
||||
fmt::Debug,
|
||||
@ -225,7 +227,13 @@ impl Installable for XtensaRust {
|
||||
|
||||
#[cfg(unix)]
|
||||
if cfg!(unix) {
|
||||
let tmp_dir = tempdir_in(get_rustup_home().join("tmp"))?;
|
||||
let path = get_rustup_home().join("tmp");
|
||||
if !path.exists() {
|
||||
info!("{} Creating directory: '{}'", emoji::WRENCH, path.display());
|
||||
create_dir_all(&path)
|
||||
.map_err(|_| Error::CreateDirectory(path.display().to_string()))?;
|
||||
}
|
||||
let tmp_dir = tempdir_in(path)?;
|
||||
let tmp_dir_path = &tmp_dir.path().display().to_string();
|
||||
|
||||
download_file(
|
||||
|
Loading…
x
Reference in New Issue
Block a user