mirror of
https://github.com/whyour/qinglong.git
synced 2026-10-01 05:13:50 +08:00
fix: finalize exited shell tasks and preserve command environments
This commit is contained in:
+3
-1
@@ -84,7 +84,9 @@ env_str_to_array() {
|
||||
}
|
||||
|
||||
clear_non_sh_env() {
|
||||
if [[ $file_param != *.sh ]]; then
|
||||
# Only automatic Node/Python preloads reconstruct the generated environment.
|
||||
# Explicit interpreters and other commands must keep the shell-loaded values.
|
||||
if [[ $isJsOrPythonFile == 'true' ]]; then
|
||||
clear_env
|
||||
fi
|
||||
}
|
||||
|
||||
+7
-1
@@ -18,6 +18,12 @@ single_hanle() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
run_shell_script() {
|
||||
# Preserve inherited variables/functions, but contain exit, exec and shell
|
||||
# options so the task wrapper can run after hooks and report completion.
|
||||
( . "$@" )
|
||||
}
|
||||
|
||||
define_program() {
|
||||
local file_param=$1
|
||||
if [[ $file_param == *.js ]] || [[ $file_param == *.mjs ]]; then
|
||||
@@ -25,7 +31,7 @@ define_program() {
|
||||
elif [[ $file_param == *.py ]] || [[ $file_param == *.pyc ]]; then
|
||||
which_program="python3"
|
||||
elif [[ $file_param == *.sh ]]; then
|
||||
which_program="."
|
||||
which_program="run_shell_script"
|
||||
elif [[ $file_param == *.ts ]]; then
|
||||
which_program="ts-node-transpile-only"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user