File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,25 @@ download_release() {
120120 )
121121}
122122
123+ check_shasum () {
124+ local sha_cmd
125+
126+ if command -v sha512sum > /dev/null; then
127+ sha_cmd=(sha512sum)
128+ elif command -v shasum > /dev/null; then
129+ sha_cmd=(shasum -a 512)
130+ else
131+ log " WARNING: sha512sum/shasum program not found - unable to checksum. Proceed with caution."
132+ return 0
133+ fi
134+
135+ (
136+ log " Checking sha512 sum..."
137+ cd " ${ASDF_DOWNLOAD_PATH} " || exit 1
138+ " ${sha_cmd[@]} " -c ./* .sha512sum
139+ )
140+ }
141+
123142install_version () {
124143 local toolname=" $1 "
125144 local install_type=" $2 "
@@ -132,15 +151,7 @@ install_version() {
132151 fail " asdf-$PLUGIN_NAME supports release installs only"
133152 fi
134153
135- if command -v sha512sum > /dev/null; then
136- (
137- log " Checking sha512 sum..."
138- cd " ${ASDF_DOWNLOAD_PATH} " || exit 1
139- sha512sum -c ./* .sha512sum
140- )
141- else
142- log " WARNING: sha512sum program not found - unable to checksum. Proceed with caution."
143- fi
154+ check_shasum
144155
145156 (
146157 local asset_path full_tool_cmd tool_cmd
You can’t perform that action at this time.
0 commit comments