mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-01 13:29:06 +02:00
docker, ci: fix --version output
When building the docker image manually, MINEDMAP_VERSION needs to be set explicitly to get a proper version string.
This commit is contained in:
parent
282f62fc30
commit
8cb1eee60b
3 changed files with 26 additions and 6 deletions
|
@ -33,17 +33,23 @@ use tracing::{info, warn};
|
|||
|
||||
use self::entity_collector::EntityCollector;
|
||||
|
||||
/// MinedMap version number
|
||||
const VERSION: &str = git_version!(
|
||||
args = ["--abbrev=7", "--match=v*", "--dirty=-modified"],
|
||||
cargo_prefix = "v",
|
||||
);
|
||||
/// Returns the MinedMap version number
|
||||
fn version() -> &'static str {
|
||||
option_env!("MINEDMAP_VERSION").unwrap_or(
|
||||
git_version!(
|
||||
args = ["--abbrev=7", "--match=v*", "--dirty=-modified"],
|
||||
cargo_prefix = "v",
|
||||
)
|
||||
.strip_prefix("v")
|
||||
.unwrap(),
|
||||
)
|
||||
}
|
||||
|
||||
/// Command line arguments for minedmap CLI
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
about,
|
||||
version = VERSION.strip_prefix("v").unwrap(),
|
||||
version = version(),
|
||||
max_term_width = 100,
|
||||
)]
|
||||
pub struct Args {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue