diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-15 22:47:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 23:47:16 +0200 |
commit | 2bb013f9baa927fc7b392766b0182b91380b9aa8 (patch) | |
tree | ca8a7ea961b50213adf0904d724974c317cefb55 /cli/args/flags.rs | |
parent | 5ec3c5c3a46ca95f355a4520676b85ac619ca102 (diff) |
refactor: `version` module exports a single const struct (#25014)
This commit rewrites the internal `version` module that exported
various information about the current executable. Instead of exporting
several consts, we are now exporting a single const structure that
contains all the necessary information.
This is the first step towards cleaning up how we use this information
and should allow us to use SUI to be able to patch this information
in already produced binary making it easier to cut new releases.
---------
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 79a6fcbd4..38953a388 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1334,7 +1334,7 @@ static UNSTABLE_HEADING: &str = "Unstable"; pub fn clap_root() -> Command { let long_version = format!( "{} ({}, {})\nv8 {}\ntypescript {}", - crate::version::deno(), + crate::version::DENO_VERSION_INFO.deno, // TODO(bartlomieju): alter what's printed here. // I think it's best if we print as follows: // <version>(+<short_git_hash>) (<release_channel>, <profile>, <target>) @@ -1346,14 +1346,17 @@ pub fn clap_root() -> Command { // v2.1.13-lts (LTS (long term support), release, aarch64-apple-darwin) // For canary it would be: // v1.46.0+25bb59d (canary, release, aarch64-apple-darwin) - if matches!(crate::version::RELEASE_CHANNEL, ReleaseChannel::Canary) { + if matches!( + crate::version::DENO_VERSION_INFO.release_channel, + ReleaseChannel::Canary + ) { "canary" } else { env!("PROFILE") }, env!("TARGET"), deno_core::v8_version(), - crate::version::TYPESCRIPT + crate::version::DENO_VERSION_INFO.typescript ); let mut cmd = run_args(Command::new("deno"), true) @@ -1368,7 +1371,7 @@ pub fn clap_root() -> Command { ) .color(ColorChoice::Auto) .term_width(800) - .version(crate::version::deno()) + .version(crate::version::DENO_VERSION_INFO.deno) .long_version(long_version) // cause --unstable flags to display at the bottom of the help text .next_display_order(1000) |