From 5cd682e69f182de90cdd45ef2ff597e767f16f2c Mon Sep 17 00:00:00 2001 From: Neboer Date: Mon, 26 May 2025 04:59:20 +0000 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=BD=BF=E7=94=A8NAPCAT=5FWR?= =?UTF-8?q?ITEPATH=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E6=8C=87=E5=AE=9Ana?= =?UTF-8?q?pcat=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');