yog-cli 0.46.1

Yog build tool — `yog build` compiles a mod and packages it as .yog.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! A mod project as the designers see it: the manifest at its root and the
//! mod a file is in.

use std::path::{Path, PathBuf};

pub use crate::media::mod_id;

/// `<root>/yog.toml`.
pub fn path(root: &Path) -> PathBuf {
    root.join(yog_ids::file::MANIFEST)
}

/// The mod `file` belongs to: the nearest folder (itself included) with a `yog.toml`.
pub fn mod_root(file: &Path) -> Option<PathBuf> {
    file.ancestors().find(|d| path(d).is_file()).map(Path::to_path_buf)
}