From 171812062306c22a36f67d4b76ebb45b2e8cc71e Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 1 Jul 2023 20:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9B=B4=E6=96=B0=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/cron.ts | 3 +-- shell/share.sh | 2 +- shell/update.sh | 20 ++++++-------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/back/services/cron.ts b/back/services/cron.ts index 47822adb..f55cb941 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -17,7 +17,6 @@ import { TASK_PREFIX, QL_PREFIX } from '../config/const'; import cronClient from '../schedule/client'; import taskLimit from '../shared/pLimit'; import { spawn } from 'cross-spawn'; -import { Fn } from 'sequelize/types/utils'; @Service() export default class CronService { @@ -281,7 +280,7 @@ export default class CronService { } } - private formatViewSort(order: (string | Fn)[][], viewQuery: any) { + private formatViewSort(order: string[][], viewQuery: any) { if (viewQuery.sorts && viewQuery.sorts.length > 0) { for (const { property, type } of viewQuery.sorts) { order.unshift([property, type]); diff --git a/shell/share.sh b/shell/share.sh index b67f0b76..8c0107aa 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -300,7 +300,7 @@ git_clone_scripts() { local branch="$3" local proxy="$4" [[ $branch ]] && local part_cmd="-b $branch " - echo -e "开始克隆仓库 $url 到 $dir\n" + echo -e "开始拉取 $url 到 $dir\n" set_proxy "$proxy" diff --git a/shell/update.sh b/shell/update.sh index f1a7ff7b..3e4717a3 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -130,13 +130,9 @@ update_repo() { make_dir "${dir_scripts}/${uniq_path}" local formatUrl="$url" - if [[ -d ${repo_path}/.git ]]; then - reset_romote_url ${repo_path} "${formatUrl}" "${branch}" - git_pull_scripts ${repo_path} "${branch}" "${proxy}" - else - rm -rf ${repo_path} &>/dev/null - git_clone_scripts "${formatUrl}" ${repo_path} "${branch}" "${proxy}" - fi + rm -rf ${repo_path} &>/dev/null + git_clone_scripts "${formatUrl}" ${repo_path} "${branch}" "${proxy}" + if [[ $exit_status -eq 0 ]]; then echo -e "\n更新${repo_path}成功...\n" diff_scripts "$repo_path" "$author" "$path" "$blackword" "$dependence" "$extensions" "$autoAddCron" "$autoDelCron" @@ -269,13 +265,9 @@ update_qinglong_static() { local no_restart="$1" local primary_branch="$2" local url="https://${mirror}.com/whyour/qinglong-static.git" - if [[ -d ${ql_static_repo}/.git ]]; then - reset_romote_url ${ql_static_repo} ${url} ${primary_branch} - git_pull_scripts ${ql_static_repo} ${primary_branch} - else - rm -rf ${ql_static_repo} &>/dev/null - git_clone_scripts ${url} ${ql_static_repo} ${primary_branch} - fi + rm -rf ${ql_static_repo} &>/dev/null + git_clone_scripts ${url} ${ql_static_repo} ${primary_branch} + if [[ $exit_status -eq 0 ]]; then echo -e "\n更新青龙静态资源成功...\n"