mirror of
https://github.com/esp-rs/espup.git
synced 2025-09-28 05:10:44 +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
|
### Changed
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Create $RUSTUP_HOME/tmp if needed (#365)
|
||||||
- Complete Xtensa Rust versions when provided one is incompleted (#366)
|
- Complete Xtensa Rust versions when provided one is incompleted (#366)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
@ -65,9 +65,8 @@ pub async fn download_file(
|
|||||||
emoji::WRENCH,
|
emoji::WRENCH,
|
||||||
output_directory
|
output_directory
|
||||||
);
|
);
|
||||||
if create_dir_all(output_directory).is_err() {
|
create_dir_all(output_directory)
|
||||||
return Err(Error::CreateDirectory(output_directory.to_string()));
|
.map_err(|_| Error::CreateDirectory(output_directory.to_string()))?;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
info!(
|
info!(
|
||||||
"{} Downloading file '{}' from '{}'",
|
"{} Downloading file '{}' from '{}'",
|
||||||
|
@ -17,6 +17,8 @@ use directories::BaseDirs;
|
|||||||
use log::{debug, info, warn};
|
use log::{debug, info, warn};
|
||||||
use miette::Result;
|
use miette::Result;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
#[cfg(unix)]
|
||||||
|
use std::fs::create_dir_all;
|
||||||
use std::{
|
use std::{
|
||||||
env,
|
env,
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
@ -225,7 +227,13 @@ impl Installable for XtensaRust {
|
|||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
if 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();
|
let tmp_dir_path = &tmp_dir.path().display().to_string();
|
||||||
|
|
||||||
download_file(
|
download_file(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user