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

use default_cache_dir in rattler #269

Merged
merged 1 commit into from
Jul 23, 2023
Merged
Changes from all 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
5 changes: 2 additions & 3 deletions crates/rattler-bin/src/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use anyhow::Context;
use futures::{stream, stream::FuturesUnordered, FutureExt, StreamExt, TryFutureExt, TryStreamExt};
use indicatif::{HumanBytes, ProgressBar, ProgressState, ProgressStyle};
use rattler::{
default_cache_dir,
install::{link_package, InstallDriver, InstallOptions, Transaction, TransactionOperation},
package_cache::PackageCache,
};
Expand Down Expand Up @@ -72,9 +73,7 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
.collect::<Result<Vec<_>, _>>()?;

// Find the default cache directory. Create it if it doesnt exist yet.
let cache_dir = dirs::cache_dir()
.ok_or_else(|| anyhow::anyhow!("could not determine cache directory for current platform"))?
.join("rattler/cache");
let cache_dir = default_cache_dir()?;
std::fs::create_dir_all(&cache_dir)
.map_err(|e| anyhow::anyhow!("could not create cache directory: {}", e))?;

Expand Down