#file-path #path #directory #bevy #file

bevy_etcetera

Tiny Bevy wrapper for etcetera: An unopinionated library for obtaining configuration, data, cache, & other directories

1 unstable release

0.1.0 Aug 18, 2024

#511 in Filesystem

MIT/Apache

7KB

bevy_etcetera

A very small bevy wrapper over etcetera. It allows you to access common directories across MacOS, Windows, and Linux.

Basic usage

bevy_etcetera = { git = "https://github.com/piedoom/bevy_etcetera" }
# Alternatively, copy the contents of `lib.rs` into your project
use bevy_etcetera::Directories;
use bevy::prelude::*;

let mut world = World::new();
let directories = Directories::new("com", "doomy", "Cool Bevy Game");
world.insert_resource(directories);

fn my_system(directories: Res<Directories>) {
  // Path dependent on OS
  let path = directories.data_dir().join("some_file").with_extension("item.ron");
}

lib.rs:

A very small bevy wrapper over etcetera. It allows you to access common directories across MacOS, Windows, and Linux.

Basic usage

use bevy_etcetera::Directories;
use bevy::prelude::*;

let mut world = World::new();
let directories = Directories::new("com", "doomy", "Cool Bevy Game");
world.insert_resource(directories);

fn my_system(directories: Res<Directories>) {
    // Path dependent on OS
    let path = directories.data_dir().join("some_file").with_extension("item.ron");
}

Dependencies

~21–31MB
~483K SLoC