mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复 shell 未定义变量错误
This commit is contained in:
parent
b508e97dc1
commit
459f465f3b
|
@ -269,6 +269,7 @@ check_file "${task_shell_params[@]}"
|
|||
if [[ $isJsOrPythonFile == 'false' ]]; then
|
||||
run_task_before "${task_shell_params[@]}"
|
||||
fi
|
||||
set_u_on="false"
|
||||
if set -o | grep -q 'nounset.*on'; then
|
||||
set_u_on="true"
|
||||
set +u
|
||||
|
|
|
@ -451,9 +451,9 @@ handle_task_start() {
|
|||
run_task_before() {
|
||||
. $file_task_before "$@"
|
||||
|
||||
if [[ $task_before ]]; then
|
||||
if [[ ${task_before:=} ]]; then
|
||||
echo -e "执行前置命令\n"
|
||||
eval "$task_before" "$@"
|
||||
eval "${task_before%;}" "$@"
|
||||
echo -e "\n执行前置命令结束\n"
|
||||
fi
|
||||
}
|
||||
|
@ -463,7 +463,7 @@ run_task_after() {
|
|||
|
||||
if [[ ${task_after:=} ]]; then
|
||||
echo -e "\n执行后置命令\n"
|
||||
eval "$task_after" "$@"
|
||||
eval "${task_after%;}" "$@"
|
||||
echo -e "\n执行后置命令结束"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user