diff --git a/shell/preload/sitecustomize.js b/shell/preload/sitecustomize.js index ec8704f2..b8883681 100644 --- a/shell/preload/sitecustomize.js +++ b/shell/preload/sitecustomize.js @@ -43,7 +43,7 @@ function run() { // Export NODE_OPTIONS so task_before can use it for any node commands 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 || ''; const commands = [ diff --git a/shell/preload/sitecustomize.py b/shell/preload/sitecustomize.py index 864a9026..2a4ad3d5 100644 --- a/shell/preload/sitecustomize.py +++ b/shell/preload/sitecustomize.py @@ -52,7 +52,7 @@ def run(): temp_file = f"/tmp/env_{os.getpid()}.json" # 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 = [