mirror of
https://github.com/vrc-get/vrc-get.git
synced 2026-06-21 09:58:08 +00:00
fix: remove folder just before installing package
This commit is contained in:
parent
7708a7271e
commit
c493b6328a
1 changed files with 4 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ use std::future::Future;
|
|||
use std::io::SeekFrom;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{env, fmt, io};
|
||||
use tokio::fs::{create_dir_all, read_dir, File, OpenOptions};
|
||||
use tokio::fs::{create_dir_all, read_dir, remove_dir_all, File, OpenOptions};
|
||||
use tokio::io::{AsyncRead, AsyncReadExt, AsyncSeekExt, AsyncWriteExt};
|
||||
|
||||
pub mod structs;
|
||||
|
|
@ -262,6 +262,9 @@ impl Environment {
|
|||
cache_file
|
||||
};
|
||||
|
||||
// remove dest folder before extract if exists
|
||||
remove_dir_all(dest_folder).await.ok();
|
||||
|
||||
// extract zip file
|
||||
// TODO: sanitize to prevent directory traversal
|
||||
let mut zip_reader = async_zip::read::seek::ZipFileReader::new(zip_file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue