Skip to content

Commit

Permalink
chore: show git version
Browse files Browse the repository at this point in the history
  • Loading branch information
Desdaemon committed May 7, 2024
1 parent 7008fbc commit 335b65f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use serde_json::Value;
mod tsconfig;

pub const VERSION: &str = env!("CARGO_PKG_VERSION");
const GIT_VERSION: &str = git_version::git_version!(args = ["--tags", "--candidates=0"], fallback = "");

#[derive(Default)]
pub struct Args<'a> {
Expand Down Expand Up @@ -82,7 +83,7 @@ pub fn parse_args<'r>(mut args: &'r [&'r str]) -> Args<'r> {
exit(0);
}
["-v" | "--version", ..] => {
eprintln!("odoo-lsp v{VERSION}");
eprintln!("odoo-lsp v{VERSION} git:{GIT_VERSION}");
exit(0);
}
["--addons-path", path, rest @ ..] => {
Expand Down Expand Up @@ -313,7 +314,6 @@ pub fn init(addons_path: &[&str], output: Option<&str>) -> miette::Result<()> {
}

pub fn self_update(nightly: bool) -> miette::Result<()> {
const GIT_VERSION: &str = git_version::git_version!(args = ["--tags", "--candidates=0"], fallback = "");
const _: () = {
if option_env!("CI").is_some() {
assert!(!GIT_VERSION.is_empty(), "Git tag must be present when running in CI");
Expand Down

0 comments on commit 335b65f

Please sign in to comment.