feat: support node test

This commit is contained in:
手瓜一十雪
2025-11-06 10:57:54 +08:00
parent eeeaddbb60
commit b1417f9b56
2 changed files with 12 additions and 0 deletions

View File

@@ -43,6 +43,12 @@ export enum NapCatCoreWorkingEnv {
}
export function loadQQWrapper (QQVersion: string): WrapperNodeApi {
if (process.env['NAPCAT_WRAPPER_PATH']) {
const wrapperPath = process.env['NAPCAT_WRAPPER_PATH'];
const nativemodule: { exports: WrapperNodeApi; } = { exports: {} as WrapperNodeApi };
process.dlopen(nativemodule, wrapperPath);
return nativemodule.exports;
}
let appPath;
if (os.platform() === 'darwin') {
appPath = path.resolve(path.dirname(process.execPath), '../Resources/app');