feat: support macOS

This commit is contained in:
Hao Guan
2024-09-03 20:17:10 +08:00
parent 7088294d8f
commit 2c67314a83
6 changed files with 33 additions and 4 deletions

View File

@@ -13,7 +13,11 @@ export class NapCatPathWrapper {
constructor(mainPath: string = dirname(fileURLToPath(import.meta.url))) {
this.binaryPath = mainPath;
let writePath: string;
writePath = this.binaryPath;
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');