Skip to content

Commit

Permalink
fix: use short git hash for deno version (denoland#21218)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Nov 15, 2023
1 parent 7687ec8 commit 4072672
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 4072672

Please sign in to comment.