Skip to content

Commit d1d5b04

Browse files
committed
fix: 下载失败时删除临时文件
1 parent a649017 commit d1d5b04

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

toolchain/scripts/tool_kit.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ download_pkg_from_url() {
956956
"strict")
957957
echo "Downloading with strict certificate validation: $__url"
958958
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
959+
rm -f "$__filename"
959960
report_error "failed to download $__url (strict certificate validation)"
960961
recommend_offline_installation "$__filename" "$__url"
961962
if [ "${PACK_RUN}" != "__TRUE__" ]; then
@@ -966,6 +967,7 @@ download_pkg_from_url() {
966967
"skip")
967968
echo "Downloading with certificate validation disabled: $__url"
968969
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
970+
rm -f "$__filename"
969971
report_error "failed to download $__url"
970972
recommend_offline_installation "$__filename" "$__url"
971973
if [ "${PACK_RUN}" != "__TRUE__" ]; then
@@ -981,6 +983,7 @@ download_pkg_from_url() {
981983
else
982984
echo "Certificate validation failed, retrying without certificate check..."
983985
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
986+
rm -f "$__filename"
984987
report_error "failed to download $__url (both secure and insecure attempts failed)"
985988
recommend_offline_installation "$__filename" "$__url"
986989
if [ "${PACK_RUN}" != "__TRUE__" ]; then

0 commit comments

Comments
 (0)