MCPcopy Create free account
hub / github.com/17cupsofcoffee/nova / base_path

Function base_path

src/fs.rs:4–9  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2use std::sync::OnceLock;
3
4pub fn base_path() -> &'static PathBuf {
5 static BASE_PATH: OnceLock<PathBuf> = OnceLock::new();
6
7 // TODO: Make this use SDL_GetBaseDir when packaging for release
8 BASE_PATH.get_or_init(|| std::env::current_dir().unwrap())
9}
10
11pub fn asset_path(path: &str) -> PathBuf {
12 base_path().join(path)

Callers 1

asset_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected