diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-16 21:42:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 22:42:19 +0200 |
commit | db75462bd6f01d4a470c2ed7b5aad2f9a877f150 (patch) | |
tree | 949922348def7305e73462ef2810648998c6316f /cli/version.rs | |
parent | ff4226a3cd20ef6cfb155ca206c745785b6e098f (diff) |
refactor: show release channel in `deno --version` (#25061)
Also simplifies handling of various release channels in `deno upgrade`
subcommand.
Diffstat (limited to 'cli/version.rs')
-rw-r--r-- | cli/version.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cli/version.rs b/cli/version.rs index 4a71d7090..dbd63f614 100644 --- a/cli/version.rs +++ b/cli/version.rs @@ -23,8 +23,7 @@ pub static DENO_VERSION_INFO: Lazy<DenoVersionInfo> = Lazy::new(|| { }); DenoVersionInfo { - // TODO(bartlomieju): fix further for RC and LTS releases - deno: if IS_CANARY { + deno: if release_channel == ReleaseChannel::Canary { concat!( env!("CARGO_PKG_VERSION"), "+", @@ -39,8 +38,7 @@ pub static DENO_VERSION_INFO: Lazy<DenoVersionInfo> = Lazy::new(|| { git_hash: GIT_COMMIT_HASH, // Keep in sync with `deno` field. - // TODO(bartlomieju): fix further for RC and LTS releases - user_agent: if IS_CANARY { + user_agent: if release_channel == ReleaseChannel::Canary { concat!( "Deno/", env!("CARGO_PKG_VERSION"), @@ -77,7 +75,7 @@ impl DenoVersionInfo { /// For stable release, a semver like, eg. `v1.46.2`. /// For canary release a full git hash, eg. `9bdab6fb6b93eb43b1930f40987fa4997287f9c8`. pub fn version_or_git_hash(&self) -> &'static str { - if IS_CANARY { + if self.release_channel == ReleaseChannel::Canary { self.git_hash } else { CARGO_PKG_VERSION |