mirror of https://github.com/jackwener/wx-cli.git
fix: full_decrypt 写入前自动创建输出目录
full_decrypt 打开 out_path 写入时未创建父目录, 首次运行 monitor_web 且 decrypted/ 不存在时会报 FileNotFoundError。 Fixes #22 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>feat/daemon-cli
parent
030680eb85
commit
7020409543
|
|
@ -367,6 +367,7 @@ def full_decrypt(db_path, out_path, enc_key):
|
||||||
file_size = os.path.getsize(db_path)
|
file_size = os.path.getsize(db_path)
|
||||||
total_pages = file_size // PAGE_SZ
|
total_pages = file_size // PAGE_SZ
|
||||||
|
|
||||||
|
os.makedirs(os.path.dirname(out_path), exist_ok=True)
|
||||||
with open(db_path, 'rb') as fin, open(out_path, 'wb') as fout:
|
with open(db_path, 'rb') as fin, open(out_path, 'wb') as fout:
|
||||||
for pgno in range(1, total_pages + 1):
|
for pgno in range(1, total_pages + 1):
|
||||||
page = fin.read(PAGE_SZ)
|
page = fin.read(PAGE_SZ)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue