手动运行非JS任务也需要添加 now 参数

This commit is contained in:
cddjr 2022-08-16 22:18:06 +08:00
parent 7accf87ef3
commit 86db2c6567
No known key found for this signature in database
GPG Key ID: 0D1E625DFCF77A9F
2 changed files with 6 additions and 2 deletions

View File

@ -279,7 +279,11 @@ export default class CronService {
if (!cmdStr.includes('task ') && !cmdStr.includes('ql ')) { if (!cmdStr.includes('task ') && !cmdStr.includes('ql ')) {
cmdStr = `task ${cmdStr}`; 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`; cmdStr = `${cmdStr} now`;
} }

View File

@ -371,7 +371,7 @@ main() {
fi fi
time_format="%Y-%m-%d %H:%M:%S" 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 case $# in
1) 1)
run_normal "$1" run_normal "$1"