@whyour/qinglong 2.17.10-rc.3 → 2.17.10-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "2.17.10-rc.3",
3
+ "version": "2.17.10-rc.4",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
package/shell/otask.sh CHANGED
@@ -269,6 +269,7 @@ check_file "${task_shell_params[@]}"
269
269
  if [[ $isJsOrPythonFile == 'false' ]]; then
270
270
  run_task_before "${task_shell_params[@]}"
271
271
  fi
272
+ set_u_on="false"
272
273
  if set -o | grep -q 'nounset.*on'; then
273
274
  set_u_on="true"
274
275
  set +u
package/shell/share.sh CHANGED
@@ -451,9 +451,9 @@ handle_task_start() {
451
451
  run_task_before() {
452
452
  . $file_task_before "$@"
453
453
 
454
- if [[ $task_before ]]; then
454
+ if [[ ${task_before:=} ]]; then
455
455
  echo -e "执行前置命令\n"
456
- eval "$task_before" "$@"
456
+ eval "${task_before%;}" "$@"
457
457
  echo -e "\n执行前置命令结束\n"
458
458
  fi
459
459
  }
@@ -463,7 +463,7 @@ run_task_after() {
463
463
 
464
464
  if [[ ${task_after:=} ]]; then
465
465
  echo -e "\n执行后置命令\n"
466
- eval "$task_after" "$@"
466
+ eval "${task_after%;}" "$@"
467
467
  echo -e "\n执行后置命令结束"
468
468
  fi
469
469
  }
@@ -462,11 +462,13 @@ let CronService = class CronService {
462
462
  if (tab.task_before) {
463
463
  commandVariable += `task_before='${tab.task_before
464
464
  .replace(/'/g, "'\\''")
465
+ .replace(/;? *\n/g, ';')
465
466
  .trim()}' `;
466
467
  }
467
468
  if (tab.task_after) {
468
469
  commandVariable += `task_after='${tab.task_after
469
470
  .replace(/'/g, "'\\''")
471
+ .replace(/;? *\n/g, ';')
470
472
  .trim()}' `;
471
473
  }
472
474
  const crontab_job_string = `${commandVariable}${command}`;