mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix: use short git hash for deno version (#21218)
This commit is contained in:
parent
7687ec87e6
commit
40726721e2
1 changed files with 7 additions and 1 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue