Skip to content

Commit

Permalink
Fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
prsabahrami committed Sep 5, 2024
1 parent dec8e94 commit cea5d1c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions extractor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ async fn main() -> Result<()> {
/// Unpack a pixi environment from a directory
pub async fn unpack(archive_dir: &Path, output_dir: &Path) -> Result<()> {
let channel_directory = archive_dir.join(std::env::var("PIXI_PACK_CHANNEL_DIRECTORY").unwrap());
let cache_dir = archive_dir.join("cache");

validate_metadata_file(archive_dir.join(std::env::var("PIXI_PACK_METADATA_PATH").unwrap()))
.await?;

create_prefix(&channel_directory, output_dir)
create_prefix(&channel_directory, &output_dir, &cache_dir)
.await
.map_err(|e| anyhow!("Could not create prefix: {}", e))?;

Expand Down Expand Up @@ -136,15 +137,11 @@ async fn collect_packages(channel_dir: &Path) -> Result<FxHashMap<String, Packag
Ok(packages)
}

async fn create_prefix(channel_dir: &Path, target_prefix: &Path) -> Result<()> {
async fn create_prefix(channel_dir: &Path, target_prefix: &Path, cache_dir: &Path) -> Result<()> {
let packages = collect_packages(channel_dir)
.await
.map_err(|e| anyhow!("could not collect packages: {}", e))?;

let cache_dir = tempfile::tempdir()
.map_err(|e| anyhow!("could not create temporary directory: {}", e))?
.into_path();

eprintln!(
"⏳ Extracting and installing {} packages...",
packages.len()
Expand Down

0 comments on commit cea5d1c

Please sign in to comment.