napcat-plugin-debug-cli 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/cli.mjs +6 -1
  2. package/package.json +1 -1
  3. package/vite.mjs +1 -1
package/cli.mjs CHANGED
@@ -5272,7 +5272,12 @@ async function deployPlugin(projectDir, remotePluginPath, rpc) {
5272
5272
  } catch {
5273
5273
  try {
5274
5274
  logInfo("插件未注册,尝试从目录加载...");
5275
- await rpc.call("loadDirectoryPlugin", destDir);
5275
+ await rpc.call("loadDirectoryPlugin", pluginName);
5276
+ try {
5277
+ await rpc.call("setPluginStatus", pluginName, true);
5278
+ await rpc.call("loadPluginById", pluginName);
5279
+ } catch {
5280
+ }
5276
5281
  logOk(`${co(pluginName, C.green, C.bold)} 首次加载成功`);
5277
5282
  } catch (e2) {
5278
5283
  logWarn(`自动加载失败: ${e2.message},请手动 load ${pluginName}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "napcat-plugin-debug-cli",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "description": "NapCat 插件调试 CLI — 连接调试服务实现热重载",
6
6
  "author": "NapNeko",
package/vite.mjs CHANGED
@@ -191,7 +191,7 @@ function napcatHmrPlugin(options = {}) {
191
191
  logHmr(`${co(pluginName, C.green, C.bold)} 已重载 (${countFiles(distDir)} 个文件)`);
192
192
  } catch {
193
193
  try {
194
- await rpc.call("loadDirectoryPlugin", destDir);
194
+ await rpc.call("loadDirectoryPlugin", pluginName);
195
195
  try {
196
196
  await rpc.call("setPluginStatus", pluginName, true);
197
197
  await rpc.call("loadPluginById", pluginName);