@whyour/qinglong 2.17.9-beta.1 → 2.17.9-beta.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/shell/otask.sh +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "2.17.9-beta.1",
3
+ "version": "2.17.9-beta.3",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
package/shell/otask.sh CHANGED
@@ -216,8 +216,13 @@ check_file() {
216
216
  if [[ -f $file_env ]]; then
217
217
  get_env_array
218
218
  if [[ $isJsOrPythonFile == 'true' ]]; then
219
- export NODE_OPTIONS="${NODE_OPTIONS} -r ${file_preload_js}"
220
- export PYTHONPATH="${PYTHONPATH}:${dir_preload}:${dir_config}"
219
+ PREV_NODE_OPTIONS="${NODE_OPTIONS}"
220
+ PREV_PYTHONPATH="${PYTHONPATH}"
221
+ if [[ $1 == *.js ]] || [[ $1 == *.ts ]]; then
222
+ export NODE_OPTIONS="${NODE_OPTIONS} -r ${file_preload_js}"
223
+ else
224
+ export PYTHONPATH="${PYTHONPATH}:${dir_preload}:${dir_config}"
225
+ fi
221
226
  else
222
227
  . $file_env
223
228
  fi
@@ -265,6 +270,10 @@ if [[ $isJsOrPythonFile == 'false' ]]; then
265
270
  run_task_before "${task_shell_params[@]}"
266
271
  fi
267
272
  main "${task_shell_params[@]}"
273
+ if [[ $isJsOrPythonFile == 'true' ]]; then
274
+ export NODE_OPTIONS="${PREV_NODE_OPTIONS}"
275
+ export PYTHONPATH="${PREV_PYTHONPATH}"
276
+ fi
268
277
  run_task_after "${task_shell_params[@]}"
269
278
  clear_env
270
279
  handle_task_end "${task_shell_params[@]}"