mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Merge pull request #225 from NobodyXu/fix/tempdir
Fix: Create `temp_dir` in `install_path`
This commit is contained in:
commit
1cfdd3b8bc
1 changed files with 7 additions and 2 deletions
|
@ -11,7 +11,6 @@ use clap::Parser;
|
|||
use log::{debug, error, info, warn, LevelFilter};
|
||||
use miette::{miette, Result, WrapErr};
|
||||
use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode};
|
||||
use tempfile::TempDir;
|
||||
use tokio::{runtime::Runtime, task::block_in_place};
|
||||
|
||||
use cargo_binstall::{binstall, *};
|
||||
|
@ -250,7 +249,13 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
|
|||
debug!("Using install path: {}", install_path.display());
|
||||
|
||||
// Create a temporary directory for downloads etc.
|
||||
let temp_dir = TempDir::new()
|
||||
//
|
||||
// Put all binaries to a temporary directory under `dst` first, catching
|
||||
// some failure modes (e.g., out of space) before touching the existing
|
||||
// binaries. This directory will get cleaned up via RAII.
|
||||
let temp_dir = tempfile::Builder::new()
|
||||
.prefix("cargo-binstall")
|
||||
.tempdir_in(&install_path)
|
||||
.map_err(BinstallError::from)
|
||||
.wrap_err("Creating a temporary directory failed.")?;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue