hyper-jump 0.11.0

A generalist all-in-one command-line version manager toolset for a more efficient development workflow.
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::ports::Paths;

/// Part of the `prefix` command, which is useful for adding
/// the installation directory to the PATH. The `prefix` command retrieves the
/// installation directory and prints it to the standard output.
pub async fn run(ctx: &crate::Context) -> miette::Result<()> {
    let paths = crate::adapters::path::FsPaths::new(ctx.dirs.root_dir.clone());
    let prefix = paths.installation_dir().await.map_err(|e| miette::miette!(e))?;

    println!("{}", prefix.display());

    Ok(())
}