use std::path::{Path, PathBuf};
pub(super) fn browser_cache_anchors(home: &Path, tool: &str) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![
home.join("Library").join("Caches").join(tool),
home.join(".cache").join(tool),
]
}
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
vec![home.join(".cache").join(tool)]
}
#[cfg(target_os = "windows")]
{
vec![home.join("AppData").join("Local").join(tool).join("Cache")]
}
}
pub(super) fn homebrew_download_anchors(home: &Path) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![
home.join("Library")
.join("Caches")
.join("Homebrew")
.join("downloads"),
home.join(".cache").join("Homebrew").join("downloads"),
]
}
#[cfg(not(target_os = "macos"))]
{
vec![home.join(".cache").join("Homebrew").join("downloads")]
}
}
pub(super) fn android_sdk_anchors(home: &Path) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![home.join("Library").join("Android").join("sdk")]
}
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
vec![
home.join("Android").join("Sdk"),
home.join("Android").join("sdk"),
]
}
#[cfg(target_os = "windows")]
{
vec![
home.join("AppData")
.join("Local")
.join("Android")
.join("Sdk"),
]
}
}
pub(super) fn deno_cache_anchors(home: &Path) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![
home.join("Library").join("Caches").join("deno"),
home.join(".cache").join("deno"),
]
}
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
vec![home.join(".cache").join("deno")]
}
#[cfg(target_os = "windows")]
{
vec![home.join("AppData").join("Local").join("deno")]
}
}
pub(super) fn simple_cache_anchors(home: &Path, tool: &str) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![
home.join("Library").join("Caches").join(tool),
home.join(".cache").join(tool),
]
}
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
vec![home.join(".cache").join(tool)]
}
#[cfg(target_os = "windows")]
{
vec![home.join("AppData").join("Local").join(tool)]
}
}
pub(super) fn ide_system_anchors(home: &Path, vendor: &str) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![home.join("Library").join("Caches").join(vendor)]
}
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
vec![home.join(".cache").join(vendor)]
}
#[cfg(target_os = "windows")]
{
vec![home.join("AppData").join("Local").join(vendor)]
}
}
pub(super) fn ide_log_anchors(home: &Path, vendor: &str) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![home.join("Library").join("Logs").join(vendor)]
}
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
vec![home.join(".cache").join(vendor)]
}
#[cfg(target_os = "windows")]
{
vec![home.join("AppData").join("Local").join(vendor)]
}
}
pub(super) fn python_cache_anchors(home: &Path, tool: &str) -> Vec<PathBuf> {
#[cfg(target_os = "macos")]
{
vec![
home.join("Library").join("Caches").join(tool),
home.join(".cache").join(tool),
]
}
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
vec![home.join(".cache").join(tool)]
}
#[cfg(target_os = "windows")]
{
vec![home.join("AppData").join("Local").join(tool).join("Cache")]
}
}