aboutsummaryrefslogtreecommitdiffstats
path: root/crates/client/src/atuin_client/mod.rs
blob: 3f36722f5b3980c44dd6570a49dba1f1cfc9fce7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub(crate) mod settings;

pub async fn current_context(session: String) -> eyre::Result<Context> {
    let hostname = get_host_user();
    let cwd = utils::get_current_dir();
    let host_id = Settings::host_id().await?;
    let git_root = utils::in_git_repo(cwd.as_str());

    Ok(Context {
        session,
        hostname,
        cwd,
        git_root,
        host_id: host_id.0.as_simple().to_string(),
    })
}