From 86db2c65675970aa4b856d51ce7bb017350cfad6 Mon Sep 17 00:00:00 2001 From: cddjr Date: Tue, 16 Aug 2022 22:18:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E8=BF=90=E8=A1=8C=E9=9D=9EJS?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B9=9F=E9=9C=80=E8=A6=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20now=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/cron.ts | 6 +++++- shell/task.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/back/services/cron.ts b/back/services/cron.ts index 0c78b237..2f27e7ac 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -279,7 +279,11 @@ export default class CronService { if (!cmdStr.includes('task ') && !cmdStr.includes('ql ')) { cmdStr = `task ${cmdStr}`; } - if (cmdStr.endsWith('.js')) { + if (cmdStr.endsWith('.js') + || cmdStr.endsWith('.py') + || cmdStr.endsWith('.pyc') + || cmdStr.endsWith('.sh') + || cmdStr.endsWith('.ts')) { cmdStr = `${cmdStr} now`; } diff --git a/shell/task.sh b/shell/task.sh index aadfa532..7ac59def 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -371,7 +371,7 @@ main() { fi time_format="%Y-%m-%d %H:%M:%S" - if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then + if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.pyc ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then case $# in 1) run_normal "$1"