Skip to content

Commit

Permalink
fix: ensure tmp dir parent is created
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Nov 12, 2024
1 parent bfc9678 commit d82537d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vfox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ impl Vfox {
fn extract(&self, file: &Path, install_dir: &Path) -> Result<()> {
self.log_emit(format!("Extracting {file:?} to {install_dir:?}"));
let filename = file.file_name().unwrap().to_string_lossy().to_string();
let tmp = TempDir::with_prefix_in(&filename, install_dir.parent().unwrap())?;
let parent = install_dir.parent().unwrap();
file::mkdirp(parent)?;
let tmp = TempDir::with_prefix_in(&filename, parent)?;
file::remove_dir_all(install_dir)?;
let move_to_install = || {
let subdirs = file::ls(tmp.path())?;
Expand Down

0 comments on commit d82537d

Please sign in to comment.