Most of the refactor. Need to switch machines.

This commit is contained in:
Olivia Brooks
2026-02-15 09:36:04 -05:00
parent dda863e512
commit e41d4bcd76
61 changed files with 3390 additions and 618 deletions

View File

@@ -0,0 +1,45 @@
mod class;
mod dependency;
mod error;
//mod lock;
mod meta;
mod nest;
mod package;
pub mod prelude;
mod prey;
mod workspace;
pub use error::{Error, Result};
use std::io;
use std::path::PathBuf;
pub const FN_NEST: &str = "Nest";
pub const FN_PREY: &str = "Prey";
pub const F_NEST_TOML: &str = const_format::concatcp!(FN_NEST, fs::EXT_TOML);
pub const F_NEST_LOCK: &str = const_format::concatcp!(FN_NEST, fs::EXT_LOCK);
pub const F_PREY_TOML: &str = const_format::concatcp!(FN_PREY, fs::EXT_TOML);
pub const F_PREY_LOCK: &str = const_format::concatcp!(FN_PREY, fs::EXT_LOCK);
/// Return the location of the parent `Nest.toml` as [`PathBuf`]
///
/// # Errors
///
/// Possible cases:
///
/// * `Nest.toml` cannot be located.
/// * Current working directory does not exist.
/// * There are insufficient permissions to access the current directory.
pub fn locate_nest() -> io::Result<PathBuf> {
let cwd = std::env::current_dir()?;
let mut probe = cwd.clone();
while !probe.join(F_NEST_TOML).exists() {
if !probe.pop() {
return Err(io::ErrorKind::NotFound.into());
}
}
Ok(probe)
}