Merge pull request #62 from Icy-Cat/fix/init-error-shows-config-path

fix(init): show config.json path in auto-detect error
pull/77/head
jackwener 2026-05-19 01:14:58 +08:00
commit 5f87ce6348
1 changed files with 7 additions and 2 deletions

View File

@ -35,8 +35,13 @@ pub fn cmd_init(force: bool) -> Result<()> {
// Step 1: 检测 db_dir
println!("检测微信数据目录...");
let db_dir = config::auto_detect_db_dir()
.context("未能自动检测到微信数据目录\n请手动编辑 config.json 中的 db_dir 字段")?;
let db_dir = config::auto_detect_db_dir().with_context(|| format!(
"未能自动检测到微信数据目录\n\
db_dir :\n \
{}\n\
db_dir : <data_root>\\xwechat_files\\<wxid>\\db_storage",
config_path.display()
))?;
println!("找到数据目录: {}", db_dir.display());
// Step 2: 扫描密钥(需要 root/sudo