From 5cd682e69f182de90cdd45ef2ff597e767f16f2c Mon Sep 17 00:00:00 2001 From: Neboer Date: Mon, 26 May 2025 04:59:20 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=BD=BF=E7=94=A8NAPCAT?= =?UTF-8?q?=5FWRITEPATH=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E6=8C=87?= =?UTF-8?q?=E5=AE=9Anapcat=E5=B7=A5=E4=BD=9C=E8=B7=AF=E5=BE=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/path.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/path.ts b/src/common/path.ts index b204cb20..8e82c52b 100644 --- a/src/common/path.ts +++ b/src/common/path.ts @@ -13,11 +13,15 @@ export class NapCatPathWrapper { constructor(mainPath: string = dirname(fileURLToPath(import.meta.url))) { this.binaryPath = mainPath; let writePath: string; - if (os.platform() === 'darwin') { + + if (process.env['NAPCAT_WRITEPATH']) { + writePath = process.env['NAPCAT_WRITEPATH']; + } else if (os.platform() === 'darwin') { writePath = path.join(os.homedir(), 'Library', 'Application Support', 'QQ', 'NapCat'); } else { writePath = this.binaryPath; } + this.logsPath = path.join(writePath, 'logs'); this.configPath = path.join(writePath, 'config'); this.cachePath = path.join(writePath, 'cache'); From 7ad3bad1bee4dbaf46aa3c714d1c81c7c753a6e8 Mon Sep 17 00:00:00 2001 From: Neboer Date: Mon, 26 May 2025 05:36:07 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=90=8D=E5=AD=97NAPCAT=5FWRITEPATH=E4=B8=BA?= =?UTF-8?q?NAPCAT=5FWORKDIR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/path.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/path.ts b/src/common/path.ts index 8e82c52b..47efc3b6 100644 --- a/src/common/path.ts +++ b/src/common/path.ts @@ -14,8 +14,8 @@ export class NapCatPathWrapper { this.binaryPath = mainPath; let writePath: string; - if (process.env['NAPCAT_WRITEPATH']) { - writePath = process.env['NAPCAT_WRITEPATH']; + if (process.env['NAPCAT_WORKDIR']) { + writePath = process.env['NAPCAT_WORKDIR']; } else if (os.platform() === 'darwin') { writePath = path.join(os.homedir(), 'Library', 'Application Support', 'QQ', 'NapCat'); } else {