summaryrefslogtreecommitdiff
path: root/cli/version.rs
diff options
context:
space:
mode:
authorcrowlKats <13135287+crowlKats@users.noreply.github.com>2020-11-25 11:30:14 +0100
committerGitHub <noreply@github.com>2020-11-25 05:30:14 -0500
commita08d2eee2b4adf0cdf6d9c8a475beff6ee1df29b (patch)
tree40bea60c844636782a2364af632243e16d8db834 /cli/version.rs
parent8d12653738066facfc228b1d0d9e31b76c6d9de0 (diff)
add canary versioning (#8480)
Diffstat (limited to 'cli/version.rs')
-rw-r--r--cli/version.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/version.rs b/cli/version.rs
index 0f2a69a5c..70185c19e 100644
--- a/cli/version.rs
+++ b/cli/version.rs
@@ -1,9 +1,15 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-pub const DENO: &str = env!("CARGO_PKG_VERSION");
pub const GIT_COMMIT_HASH: &str = env!("GIT_COMMIT_HASH");
pub const TYPESCRIPT: &str = crate::js::TS_VERSION;
+pub fn deno() -> String {
+ let semver = env!("CARGO_PKG_VERSION");
+ option_env!("DENO_CANARY").map_or(semver.to_string(), |_| {
+ format!("{}-{}", semver, GIT_COMMIT_HASH)
+ })
+}
+
pub fn v8() -> &'static str {
deno_core::v8_version()
}