mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 05:05:44 +08:00
* feat: pnpm new * Refactor build and release workflows, update dependencies Switch build scripts and workflows from npm to pnpm, update build and artifact paths, and simplify release workflow by removing version detection and changelog steps. Add new dependencies (silk-wasm, express, ws, node-pty-prebuilt-multiarch), update exports in package.json files, and add vite config for napcat-framework. Also, rename manifest.json for framework package and fix static asset copying in shell build config.
26 lines
896 B
JavaScript
26 lines
896 B
JavaScript
// const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
async function initializeNapCat (session, loginService, registerCallback) {
|
|
// const logFile = path.join(currentPath, 'napcat.log');
|
|
|
|
console.log('[NapCat] [Info] 开始初始化NapCat');
|
|
|
|
// fs.writeFileSync(logFile, '', { flag: 'w' });
|
|
|
|
// fs.writeFileSync(logFile, '[NapCat] [Info] NapCat 初始化成功\n', { flag: 'a' });
|
|
|
|
try {
|
|
const currentPath = path.dirname(__filename);
|
|
const { NCoreInitFramework } = await import('file://' + path.join(currentPath, './napcat.mjs'));
|
|
await NCoreInitFramework(session, loginService, (callback) => { registerCallback(callback); });
|
|
} catch (error) {
|
|
console.log('[NapCat] [Error] 初始化NapCat', error);
|
|
// fs.writeFileSync(logFile, `[NapCat] [Error] 初始化NapCat失败: ${error.message}\n`, { flag: 'a' });
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
initializeNapCat,
|
|
};
|