From 7d0cae783983e723ad22450564481413441073ad Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 13 Jun 2024 22:53:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=95=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E4=BB=A3=E7=90=86=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/env.ts | 2 +- back/config/subscription.ts | 4 +++- shell/update.sh | 16 +++++----------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/back/api/env.ts b/back/api/env.ts index 32b72124..b916bdc0 100644 --- a/back/api/env.ts +++ b/back/api/env.ts @@ -217,7 +217,7 @@ export default (app: Router) => { } else { return res.send({ code: 400, - message: '文件缺少name或者value字段,参考导出文件格式', + message: '每条数据 name 或者 value 字段不能为空,参考导出文件格式', }); } } catch (e) { diff --git a/back/config/subscription.ts b/back/config/subscription.ts index d6334c8c..0973948b 100644 --- a/back/config/subscription.ts +++ b/back/config/subscription.ts @@ -32,7 +32,9 @@ export function formatCommand(doc: Subscription, url?: string) { autoDelCron, } = doc; if (type === 'file') { - command += `raw "${_url}"`; + command += `raw "${_url}" "${proxy || ''}" "${ + isNil(autoAddCron) ? true : Boolean(autoAddCron) + }" "${isNil(autoDelCron) ? true : Boolean(autoDelCron)}"`; } else { command += `repo "${_url}" "${whitelist || ''}" "${blacklist || ''}" "${ dependences || '' diff --git a/shell/update.sh b/shell/update.sh index 45e1a9f3..12fe3c02 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -156,21 +156,15 @@ update_raw() { autoDelCron=${AutoDelCron} fi - local proxyStr="" - if [[ $proxy ]]; then - if [[ $url == http:* ]]; then - proxyStr="-e \"http_proxy=${proxy}\"" - elif [[ $url == https:* ]]; then - proxyStr="-e \"https_proxy=${proxy}\"" - fi - fi - local raw_url="$url" local suffix="${raw_url##*.}" local raw_file_name="${uniq_path}.${suffix}" echo -e "开始下载:${raw_url} \n\n保存路径:$dir_raw/${raw_file_name}\n" - wget -q --no-check-certificate $proxyStr -O "$dir_raw/${raw_file_name}.new" ${raw_url} + set_proxy "$proxy" + wget -q --no-check-certificate -O "$dir_raw/${raw_file_name}.new" ${raw_url} + exit_status=$? + unset_proxy if [[ $? -eq 0 ]]; then mv "$dir_raw/${raw_file_name}.new" "$dir_raw/${raw_file_name}" @@ -527,7 +521,7 @@ main() { raw) get_uniq_path "$p2" if [[ -n $p2 ]]; then - update_raw "$p2" "$p3" "$p4" + update_raw "$p2" "$p3" "$p4" "$p5" else eval echo -e "命令输入错误...\\\n" $cmd eval usage $cmd