diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-15 20:59:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 21:59:16 +0200 |
commit | e8d57cd3feb169c6a8e9cb11d96c0f2d0b7d50f8 (patch) | |
tree | aaaa9aa09a41888d2b09167c30eda3e0b07d4036 /cli/args/flags.rs | |
parent | 8749d651fb5e0964cdb8e62be7a59a603cbc3c7c (diff) |
refactor: remove version::is_canary(), use ReleaseChannel instead (#25053)
In preparation for https://github.com/denoland/deno/pull/25014, this
commit removes public `is_canary()` method and instead uses an enum
`ReleaseChannel` to be able to designate more "kinds" of builds.
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 266907b13..79a6fcbd4 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -36,6 +36,7 @@ use std::path::PathBuf; use std::str::FromStr; use crate::args::resolve_no_prompt; +use crate::shared::ReleaseChannel; use crate::util::fs::canonicalize_path; use super::flags_net; @@ -1334,7 +1335,18 @@ pub fn clap_root() -> Command { let long_version = format!( "{} ({}, {})\nv8 {}\ntypescript {}", crate::version::deno(), - if crate::version::is_canary() { + // 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>) + // For stable it would be: + // v1.46.0 (stable, release, aarch64-apple-darwin) + // For rc it would be: + // v1.46.0-rc.2 (release candidate, release, aarch64-apple-darwin) + // For lts it would be: + // 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) { "canary" } else { env!("PROFILE") |