summaryrefslogtreecommitdiff
path: root/cli/build.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-11-15 20:24:13 +0100
committerGitHub <noreply@github.com>2023-11-15 19:24:13 +0000
commit40726721e287b2d6c44839d9081dccb408886cab (patch)
tree1f658406ba52503100094a74363fbc743b4548d6 /cli/build.rs
parent7687ec87e6c9725abb5207a2a4179772145c9939 (diff)
fix: use short git hash for deno version (#21218)
Diffstat (limited to 'cli/build.rs')
-rw-r--r--cli/build.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/build.rs b/cli/build.rs
index 1480bb5c7..6be93777e 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -356,9 +356,15 @@ fn create_cli_snapshot(snapshot_path: PathBuf) -> CreateSnapshotOutput {
use deno_runtime::permissions::PermissionsContainer;
use std::sync::Arc;
+ // NOTE(bartlomieju): keep in sync with `cli/version.rs`.
+ // Ideally we could deduplicate that code.
fn deno_version() -> String {
if env::var("DENO_CANARY").is_ok() {
- format!("{}+{}", env!("CARGO_PKG_VERSION"), git_commit_hash())
+ format!(
+ "{}+{}",
+ env!("CARGO_PKG_VERSION"),
+ git_commit_hash()[..7].to_string()
+ )
} else {
env!("CARGO_PKG_VERSION").to_string()
}