mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
fix: merge script now writes to current directory for volume compatibility
Changed merge_jsonl.py to use os.getcwd() instead of os.path.dirname(__file__) to ensure merged.jsonl is written to the working directory where data files exist, not to the script's installation directory. Root cause: - Dockerfile copies scripts to /app/scripts/ for volume compatibility - entrypoint.sh runs: cd /app/data && python /app/scripts/merge_jsonl.py - Old logic used script directory (/app/scripts/), ignoring working directory - This caused merged.jsonl to be created in /app/scripts/ instead of /app/data/ - Since /app/data/ is volume-mounted, merged file was not visible to host Solution: - Scripts now respect current working directory (Unix philosophy) - Works correctly with volume mounts and script relocation - Tested in both local and Docker directory structure scenarios Fixes the issue where merged.jsonl was missing from mounted data volume.
This commit is contained in:
@@ -18,7 +18,8 @@ all_nasdaq_100_symbols = [
|
||||
]
|
||||
|
||||
# 合并所有以 daily_price 开头的 json,逐文件一行写入 merged.jsonl
|
||||
current_dir = os.path.dirname(__file__)
|
||||
# Use current working directory instead of script directory for volume compatibility
|
||||
current_dir = os.getcwd()
|
||||
pattern = os.path.join(current_dir, 'daily_price*.json')
|
||||
files = sorted(glob.glob(pattern))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user