Skip to content

Commit b619b3e

Browse files
committed
feat: add --version flag with dev suffix for local builds
1 parent 9355851 commit b619b3e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "latest"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
edition = "2024"
55
description = "Find the latest version of any command, package, or library"
66
license = "MIT"

src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,15 @@ fn sanitize_output(s: &str) -> String {
3636
result
3737
}
3838

39+
const VERSION: &str = if option_env!("GITHUB_ACTIONS").is_some() {
40+
env!("CARGO_PKG_VERSION")
41+
} else {
42+
concat!(env!("CARGO_PKG_VERSION"), "-dev")
43+
};
44+
3945
#[derive(Parser)]
4046
#[command(name = "latest")]
47+
#[command(version = VERSION)]
4148
#[command(about = "Find the latest version of any command, package, or library")]
4249
#[allow(clippy::struct_excessive_bools)]
4350
struct Cli {

0 commit comments

Comments
 (0)