Skip to content

Commit

Permalink
use default_cache_dir in rattler (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Jul 23, 2023
1 parent 5bfb957 commit 9973c76
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 9973c76

Please sign in to comment.