summaryrefslogtreecommitdiff
path: root/cli/version.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/version.rs')
-rw-r--r--cli/version.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/version.rs b/cli/version.rs
index 00301c85d..1a96eb234 100644
--- a/cli/version.rs
+++ b/cli/version.rs
@@ -14,6 +14,14 @@ pub fn is_canary() -> bool {
option_env!("DENO_CANARY").is_some()
}
+pub fn release_version_or_canary_commit_hash() -> &'static str {
+ if is_canary() {
+ GIT_COMMIT_HASH
+ } else {
+ env!("CARGO_PKG_VERSION")
+ }
+}
+
pub fn get_user_agent() -> String {
format!("Deno/{}", deno())
}