melatonin 0.9.1

A version manager for the BYOND environment
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use anyhow::Result;
use melatonin::{helpers::userstring_to_byond_version, manifest::inventory::InventoryManifest};

pub(crate) fn prefix(version_string: String) -> Result<()> {
	let byond_version = userstring_to_byond_version(&version_string)?;
	let inventory = InventoryManifest::new();
	match inventory.get(byond_version)? {
		Some(version) => {
			print!("{}", version.path.display());
			Ok(())
		}
		None => {
			print!("{byond_version} not installed");
			std::process::exit(1);
		}
	}
}