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');