no separate roc_cache_packages_dir() for wasm

since `roc_cache_packages_dir()` is essentially just calling `roc_cache_dir()` and joining with `PACKAGES_DIR_NAME`, we don’t need a separate implementation for the WebAssembly target since `roc_cache_dir()` already has a separate implementation
This commit is contained in:
Omar Jatoi 2024-10-03 13:06:01 -04:00
parent 3f318e2235
commit 820dccab99
No known key found for this signature in database

View file

@ -260,13 +260,6 @@ pub fn roc_cache_dir() -> PathBuf {
}
}
/// Returns a path of the form roc_cache_dir().join("packages")
#[cfg(not(target_family = "wasm"))]
pub fn roc_cache_packages_dir() -> PathBuf {
const PACKAGES_DIR_NAME: &str = "packages";
roc_cache_dir().join(PACKAGES_DIR_NAME)
}
/// WASI doesn't have a home directory, so just make the cache dir in the current directory
/// https://github.com/WebAssembly/wasi-filesystem/issues/59
#[cfg(target_family = "wasm")]
@ -274,12 +267,8 @@ pub fn roc_cache_dir() -> PathBuf {
PathBuf::from(".cache").join(ROC_CACHE_DIR_NAME)
}
/// WASI doesn't have a home directory, so just make the cache dir in the current directory
/// https://github.com/WebAssembly/wasi-filesystem/issues/59
#[cfg(target_family = "wasm")]
/// Returns a path of the form roc_cache_dir().join("packages")
pub fn roc_cache_packages_dir() -> PathBuf {
const PACKAGES_DIR_NAME: &str = "packages";
PathBuf::from(".cache")
.join(ROC_CACHE_DIR_NAME)
.join(PACKAGES_DIR_NAME)
roc_cache_dir().join(PACKAGES_DIR_NAME)
}