[🛠️ Fix] Emergency fix for invalid config read logic

1. [/] 紧急修复了上个 commit 中引入的错误路径获取逻辑
This commit is contained in:
Minoricew
2025-06-17 00:16:43 +08:00
parent 6be31652f9
commit 0494394fd8
8 changed files with 69 additions and 45 deletions

View File

@@ -69,7 +69,7 @@ const deepMerge = (target, source) => {
class ConfigManager {
constructor() {
this.configDir = path.join(global.__HUGO_AURA__.logDir, "..");
this.configDir = global.__HUGO_AURA__.auraDir;
this.configPath = path.join(this.configDir, "config.json");
this.encConfigPath = path.join(this.configDir, ".cache_2eafc8d0.dat"); // (雾
/* ↑ 不使用 .tmp 扩展名, 不然容易真被清理了 */
@@ -99,6 +99,7 @@ class ConfigManager {
if (this.configDir === path.join(os.homedir(), "Documents", "HugoAura")) {
return;
}
const oldConfigPath = path.join(
os.homedir(),
"Documents",
@@ -111,6 +112,7 @@ class ConfigManager {
"HugoAura",
".cache_2eafc8d0.dat"
);
if (fs.existsSync(oldConfigPath)) {
fs.copyFileSync(oldConfigPath, this.configPath);
fs.unlinkSync(oldConfigPath);