mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-05 08:14:32 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 929d2eb574 | |||
| ebedd994dd | |||
| ee7d39f433 | |||
| eab8a93f28 | |||
| 16b20e8b54 | |||
| 6dbd980881 | |||
| 35a17fce95 |
@@ -28,6 +28,7 @@ function run() {
|
||||
numParam,
|
||||
file_task_before,
|
||||
file_task_before_js,
|
||||
file_preload_js,
|
||||
dir_scripts,
|
||||
task_before,
|
||||
PREV_NODE_OPTIONS,
|
||||
@@ -40,7 +41,13 @@ function run() {
|
||||
const fileName = process.argv[1].replace(`${dir_scripts}/`, '');
|
||||
const tempFile = `/tmp/env_${process.pid}.json`;
|
||||
|
||||
// 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].filter(Boolean).join(' ')
|
||||
: PREV_NODE_OPTIONS || '';
|
||||
|
||||
const commands = [
|
||||
`export NODE_OPTIONS="${nodeOptionsForBash}"`,
|
||||
`source ${file_task_before} ${fileName}`,
|
||||
task_before ? `eval '${task_before.replace(/'/g, "'\\''")}'` : null,
|
||||
`echo -e '${splitStr}'`,
|
||||
|
||||
@@ -44,11 +44,19 @@ def run():
|
||||
split_str = "__sitecustomize__"
|
||||
file_name = sys.argv[0].replace(f"{os.getenv('dir_scripts')}/", "")
|
||||
|
||||
# Get environment variables needed for PYTHONPATH
|
||||
dir_preload = os.getenv("dir_preload", "")
|
||||
dir_config = os.getenv("dir_config", "")
|
||||
|
||||
# 创建临时文件路径
|
||||
temp_file = f"/tmp/env_{os.getpid()}.json"
|
||||
|
||||
# Export PYTHONPATH so task_before can use it for any python commands
|
||||
pythonpath_for_bash = ':'.join(filter(None, [dir_preload, dir_config, prev_pythonpath]))
|
||||
|
||||
# 构建命令数组
|
||||
commands = [
|
||||
f'export PYTHONPATH="{pythonpath_for_bash}"',
|
||||
f'source {os.getenv("file_task_before")} {file_name}'
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user