mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-23 00:34:20 +01:00
Include revision in status (#1166)
This commit is contained in:
parent
925bf0efaa
commit
b207d0d9a5
10
atuin/build.rs
Normal file
10
atuin/build.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
use std::process::Command;
|
||||||
|
fn main() {
|
||||||
|
let output = Command::new("git")
|
||||||
|
.args(["rev-parse", "HEAD"])
|
||||||
|
.output()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||||
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
use crate::{SHA, VERSION};
|
||||||
use atuin_client::{api_client, database::Database, settings::Settings};
|
use atuin_client::{api_client, database::Database, settings::Settings};
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use eyre::Result;
|
use eyre::Result;
|
||||||
@ -9,6 +10,8 @@ pub async fn run(settings: &Settings, db: &impl Database) -> Result<()> {
|
|||||||
let last_sync = Settings::last_sync()?;
|
let last_sync = Settings::last_sync()?;
|
||||||
let local_count = db.history_count().await?;
|
let local_count = db.history_count().await?;
|
||||||
|
|
||||||
|
println!("Atuin v{VERSION} - Build rev {SHA}\n");
|
||||||
|
|
||||||
println!("{}", "[Local]".green());
|
println!("{}", "[Local]".green());
|
||||||
|
|
||||||
if settings.auto_sync {
|
if settings.auto_sync {
|
||||||
|
@ -8,6 +8,7 @@ use command::AtuinCmd;
|
|||||||
mod command;
|
mod command;
|
||||||
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
const SHA: &str = env!("GIT_HASH");
|
||||||
|
|
||||||
static HELP_TEMPLATE: &str = "\
|
static HELP_TEMPLATE: &str = "\
|
||||||
{before-help}{name} {version}
|
{before-help}{name} {version}
|
||||||
|
Loading…
Reference in New Issue
Block a user