Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix leaking package cache directory #47

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pixi-pack"
description = "A command line tool to pack and unpack conda environments for easy sharing"
version = "0.1.7"
version = "0.1.8"
edition = "2021"

[features]
Expand Down
11 changes: 6 additions & 5 deletions src/unpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,14 @@ async fn create_prefix(channel_dir: &Path, target_prefix: &Path) -> Result<()> {
.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();
let tmp_dir =
tempfile::tempdir().map_err(|e| anyhow!("Could not create temporary directory: {}", e))?;
let cache_dir = tmp_dir.path();
delsner marked this conversation as resolved.
Show resolved Hide resolved

eprintln!(
"⏳ Extracting and installing {} packages...",
packages.len()
"⏳ Extracting and installing {} packages to {}...",
packages.len(),
cache_dir.display()
);
let reporter = ProgressReporter::new(packages.len() as u64);

Expand Down