pineapple_data/
lib.rs

1// Copyright (c) 2025-2026, Tom Ouellette
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// A copy of the License has been included in the root of the repository.
5
6use dirs::home_dir;
7
8pub fn get_pineapple_cache() -> std::path::PathBuf {
9    if let Ok(pineapple_cache) = std::env::var("THYME_CACHE")
10        && !pineapple_cache.is_empty() {
11        return std::path::PathBuf::from(pineapple_cache);
12    }
13
14    if let Some(home) = home_dir() {
15        return home.join(".pineapple_cache");
16    }
17
18    std::path::PathBuf::from("/.pineapple_cache")
19}
20
21pub mod data;
22pub mod request;