zacor 0.1.0

Package manager and dispatcher for zr — install, manage, and run modular CLI packages
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::error::*;
use crate::receipt;
use std::path::Path;

pub fn run(home: &Path, name: &str, version: &str) -> Result<()> {
    let mut r = receipt::require(home, name)?;

    r.require_version(name, version)?;

    r.current = version.to_string();
    receipt::write(home, name, &r)?;
    eprintln!("switched {} to v{}", name, version);
    Ok(())
}