From ffbc7843aa5dfe419076b146439ad03ee4f51916 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 1 Aug 2024 14:23:53 +0100 Subject: feat(remote): `--version` get from cargo package instead of manually set. aligns with ngit version. --- src/git_remote_helper.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs index 58c3bf8..4c6b9fc 100644 --- a/src/git_remote_helper.rs +++ b/src/git_remote_helper.rs @@ -54,7 +54,9 @@ async fn main() -> Result<()> { bail!("invalid arguments - no url"); }; if env::args().nth(1).as_deref() == Some("--version") { - println!("v0.0.1"); + const VERSION: &str = env!("CARGO_PKG_VERSION"); + println!("v{VERSION}"); + return Ok(()); } let git_repo = Repo::from_path(&PathBuf::from( -- cgit v1.2.3