mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
允许使用NAPCAT_WRITEPATH环境变量指定napcat工作路径。
This commit is contained in:
@@ -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');
|
||||
|
Reference in New Issue
Block a user