diff --git a/script/download-file/customize.py b/script/download-file/customize.py index c8834f1ce6..becf4ab420 100644 --- a/script/download-file/customize.py +++ b/script/download-file/customize.py @@ -168,19 +168,9 @@ def preprocess(i): # have to modify the variable from url to temp_url if it is going to be used anywhere after this point url = url.replace("%", "%%") temp_download_file = env['CM_DOWNLOAD_FILENAME'].replace("%", "%%") - env['CM_DOWNLOAD_CMD'] = f"rclone {rclone_copy_using} {q}{url}{q} {q}{os.path.join(os.getcwd(), temp_download_file)}{q} -P" + env['CM_DOWNLOAD_CMD'] = f"rclone {rclone_copy_using} {q}{url}{q} {q}{os.path.join(os.getcwd(), temp_download_file)}{q} -P --error-on-no-transfer" else: - env['CM_DOWNLOAD_CMD'] = f"rclone {rclone_copy_using} {q}{url}{q} {q}{os.path.join(os.getcwd(), env['CM_DOWNLOAD_FILENAME'])}{q} -P" - for i in range(1,5): - url = env.get('CM_DOWNLOAD_URL'+str(i),'') - if url == '': - break - if env["CM_HOST_OS_TYPE"] == "windows": - url = url.replace("%", "%%") - temp_download_file = env['CM_DOWNLOAD_FILENAME'].replace("%", "%%") - env['CM_DOWNLOAD_CMD'] = f" || ((rm -f {env['CM_DOWNLOAD_FILENAME']} || true) && rclone {rclone_copy_using} {q}{url}{q} {q}{os.path.join(os.getcwd(), temp_download_file)}{q} -P)" - else: - env['CM_DOWNLOAD_CMD'] = f" || ((rm -f {env['CM_DOWNLOAD_FILENAME']} || true) && rclone {rclone_copy_using} {q}{url}{q} {q}{os.path.join(os.getcwd(), env['CM_DOWNLOAD_FILENAME'])}{q} -P" + env['CM_DOWNLOAD_CMD'] = f"rclone {rclone_copy_using} {q}{url}{q} {q}{os.path.join(os.getcwd(), env['CM_DOWNLOAD_FILENAME'])}{q} -P --error-on-no-transfer" filename = env['CM_DOWNLOAD_FILENAME'] env['CM_DOWNLOAD_DOWNLOADED_FILENAME'] = filename diff --git a/script/download-file/run.sh b/script/download-file/run.sh index 91f5428c9d..8fdefc7502 100644 --- a/script/download-file/run.sh +++ b/script/download-file/run.sh @@ -35,8 +35,10 @@ fi if [[ ${require_download} == "1" ]]; then echo "" - echo ${CM_PRE_DOWNLOAD_CLEAN_CMD} - ${CM_PRE_DOWNLOAD_CLEAN_CMD} + if [ -e "${CM_PRE_DOWNLOAD_CLEAN}" ]; then + echo ${CM_PRE_DOWNLOAD_CLEAN_CMD} + ${CM_PRE_DOWNLOAD_CLEAN_CMD} + fi echo "" echo "${CM_DOWNLOAD_CMD}"