From 9f7cd91d3906e88996ed33e83897c937200d5c8c Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 4 Apr 2021 16:11:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgit=5Fpull=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/data/cron.ts | 2 +- shell/api.sh | 1 - shell/git_pull.sh | 5 ++--- src/pages/crontab/index.tsx | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/back/data/cron.ts b/back/data/cron.ts index 40c0d54d..9c6e96ad 100644 --- a/back/data/cron.ts +++ b/back/data/cron.ts @@ -18,7 +18,7 @@ export class Crontab { this.created = options.created; this.status = options.status || CrontabStatus.idle; this.timestamp = new Date().toString(); - this.isSystem = options.isSystem; + this.isSystem = options.isSystem || 0; } } diff --git a/shell/api.sh b/shell/api.sh index 556ed372..1627468e 100755 --- a/shell/api.sh +++ b/shell/api.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash get_token() { - echo $AuthConf local authInfo=$(cat $AuthConf) token=$(get_json_value "$authInfo" "token") } diff --git a/shell/git_pull.sh b/shell/git_pull.sh index a6d6d3d0..82c434a1 100755 --- a/shell/git_pull.sh +++ b/shell/git_pull.sh @@ -198,7 +198,7 @@ Git_Pull_Scripts_Next() { Diff_Cron() { cat $ListCronRemote | grep -E "node.+j[drx]_\w+\.js" | perl -pe "s|.+(j[drx]_\w+)\.js.+|\1|" | sort -u >$ListRemoteTask - cat $ListCronCurrent | grep -E "$ShellJs j[drx]_\w+" | perl -pe "s|.*ID=(.*)$ShellJs (j[drx]_\w+)\.*|\1:\2|" | sort -u >$ListCurrentTask + cat $ListCronCurrent | grep -E "$ShellJs j[drx]_\w+" | perl -pe "s|.*ID=(.*) $ShellJs (j[drx]_\w+)\.*|\2|" | sort -u >$ListCurrentTask if [ -s $ListCurrentTask ]; then grep -vwf $ListCurrentTask $ListRemoteTask >$ListJsAdd else @@ -218,8 +218,7 @@ Del_Cron() { echo JsDrop=$(cat $ListJsDrop) for Cron in $JsDrop; do - local id=$(echo "$1" | awk -F ":" '{print $1}') - local name=$(echo "$1" | awk -F ":" '{print $2}') + local id=$(cat $ListCronCurrent | grep -E "js $Cron" | perl -pe "s|.*ID=(.*) js $Cron|\1|") del_cron_api "$id" done crontab $ListCronCurrent diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index d518af85..11c95e4a 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -261,7 +261,7 @@ const Crontab = () => { }> 编辑 - {record.isSystem === 0 && ( + {record.isSystem !== 0 && ( <>