mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-13 07:25:05 +08:00
Improve string handling for NODE_OPTIONS and PYTHONPATH
Use filter(Boolean).join() to avoid extra spaces and properly handle missing environment variables. This ensures clean paths even when some variables are empty or undefined. Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
ee7d39f433
commit
ebedd994dd
|
|
@ -43,7 +43,7 @@ function run() {
|
||||||
|
|
||||||
// Export NODE_OPTIONS so task_before can use it for any node commands
|
// Export NODE_OPTIONS so task_before can use it for any node commands
|
||||||
const nodeOptionsForBash = file_preload_js
|
const nodeOptionsForBash = file_preload_js
|
||||||
? `-r ${file_preload_js} ${PREV_NODE_OPTIONS || ''}`
|
? ['-r', file_preload_js, PREV_NODE_OPTIONS].filter(Boolean).join(' ')
|
||||||
: PREV_NODE_OPTIONS || '';
|
: PREV_NODE_OPTIONS || '';
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ def run():
|
||||||
temp_file = f"/tmp/env_{os.getpid()}.json"
|
temp_file = f"/tmp/env_{os.getpid()}.json"
|
||||||
|
|
||||||
# Export PYTHONPATH so task_before can use it for any python commands
|
# Export PYTHONPATH so task_before can use it for any python commands
|
||||||
pythonpath_for_bash = f"{dir_preload}:{dir_config}:{prev_pythonpath}" if dir_preload else prev_pythonpath
|
pythonpath_for_bash = ':'.join(filter(None, [dir_preload, dir_config, prev_pythonpath]))
|
||||||
|
|
||||||
# 构建命令数组
|
# 构建命令数组
|
||||||
commands = [
|
commands = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user