Skip to content

Commit

Permalink
fix: full commit hash in canary compile download (denoland#9166)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Jan 19, 2021
1 parent 867ce78 commit cf32026
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn git_commit_hash() -> String {
.output()
{
if output.status.success() {
std::str::from_utf8(&output.stdout[..7])
std::str::from_utf8(&output.stdout[..40])
.unwrap()
.to_string()
} else {
Expand Down
4 changes: 1 addition & 3 deletions cli/tools/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ pub async fn upgrade_command(
let install_version = match version {
Some(passed_version) => {
let current_is_passed = if canary {
let mut passed_hash = passed_version.clone();
passed_hash.truncate(7);
crate::version::GIT_COMMIT_HASH == passed_hash
crate::version::GIT_COMMIT_HASH == passed_version
} else if !crate::version::is_canary() {
crate::version::deno() == passed_version
} else {
Expand Down
2 changes: 1 addition & 1 deletion cli/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub const TYPESCRIPT: &str = env!("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)
format!("{}+{}", semver, &GIT_COMMIT_HASH[..7])
})
}

Expand Down

0 comments on commit cf32026

Please sign in to comment.