From dee9adaac3e587fdb51529bd06fd9e129807f85f Mon Sep 17 00:00:00 2001 From: s_c_c Date: Thu, 25 Apr 2024 21:29:16 +0800 Subject: [PATCH] fix:add download_file function parameters --- scripts/install_rpms.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/install_rpms.sh b/scripts/install_rpms.sh index 96c9e92..8edac9c 100755 --- a/scripts/install_rpms.sh +++ b/scripts/install_rpms.sh @@ -6,8 +6,12 @@ function download_file() { local url="$1" local file_path=$(basename "$url") - display_alert "download_file ${file_path} begin ..." "" "info" - pushd ${DOWNLOAD_DIR} + local dest_dir=${DOWNLOAD_DIR} + if [ $# -eq 2 ]; then + dest_dir=$2 + fi + display_alert "download_file ${file_path} to ${dest_dir} begin ..." "" "info" + pushd ${dest_dir} if [ ! -f "$file_path" ]; then wget -q --show-progress --progress=bar:force "$url" -O "$file_path" --no-check-certificate # 检查文件是否下载成功 -- Gitee