Skip to content

Commit 5edf1d0

Browse files
committed
Validate sha256sum for v2.0.1 and above versions only
Signed-off-by: ghosind <ghosind@gmail.com>
1 parent ef9ea2f commit 5edf1d0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

dvm.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,20 +1400,23 @@ export DVM_VERSION="v0.9.1"
14001400
# - $1: The Deno version to install.
14011401
dvm_validate_download_file() {
14021402
local version
1403+
local download_url
14031404
local download_file
14041405
local sha256sum_url
14051406
local sha256sum_file
14061407
local checksum
14071408
local checksum_expected
14081409

14091410
version="$1"
1411+
download_url="$2"
1412+
14101413
download_file="$DVM_DIR/download/$version/$DVM_TARGET_NAME"
1411-
sha256sum_url="$2.sha256sum"
1414+
sha256sum_url="$download_url.sha256sum"
14121415
sha256sum_file="$download_file.sha256sum"
14131416

14141417
if [ "$DVM_INSTALL_SHA256SUM" = true ] &&
14151418
dvm_has shasum &&
1416-
! dvm_compare_version "$version" "v2.0.0"
1419+
! dvm_compare_version "$version" "v2.0.1"
14171420
then
14181421
dvm_debug "downloading sha256sum file: $sha256sum_url"
14191422

test/test_install_version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ dvm_test_error() {
88
# shellcheck disable=SC1091
99
\. ./dvm.sh || dvm_test_error "failed to install dvm"
1010

11-
# Install deno v2.0.0
12-
TARGET_VERSION="2.0.0"
11+
# Install deno v2.2.0
12+
TARGET_VERSION="2.2.0"
1313
dvm install "v$TARGET_VERSION" --skip-validation --sha256sum || dvm_test_error "run 'dvm install v$TARGET_VERSION' failed"
1414

1515
# Check installed version directory

0 commit comments

Comments
 (0)