hotcat-bot-qq 0.1.2 → 0.1.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hotcat-bot-qq",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "基于 node-napcat-ts 的 TypeScript QQ 机器人框架",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -54,7 +54,7 @@
54
54
  "scripts": {
55
55
  "build": "tsc -p tsconfig.build.json",
56
56
  "test": "echo \"Error: no test specified\" && exit 1",
57
- "postinstall": "node scripts/postinstall.mjs || bun scripts/postinstall.mjs || echo skip",
57
+ "postinstall": "bun run scripts/postinstall.mjs",
58
58
  "prepublishOnly": "bun run build",
59
59
  "docs:dev": "vitepress dev docs",
60
60
  "docs:build": "vitepress build docs",
@@ -7,7 +7,7 @@ import * as os from 'os'
7
7
  export class HotCatPlugin extends PluginBase {
8
8
  static meta = {
9
9
  name: 'hotCatPlugin',
10
- version: '0.1.1',
10
+ version: '0.1.3',
11
11
  description: 'HotCat 默认插件(#hotCat 指令查询 bot 状态)',
12
12
  author: 'CHCAT1320',
13
13
  }
@@ -6,14 +6,16 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
6
6
  const src = join(__dirname, '..', 'plugins', 'hotCatPlugin')
7
7
  const dest = join(process.cwd(), 'plugins', 'hotCatPlugin')
8
8
 
9
- if (existsSync(dest)) {
10
- console.log('[hotCatBot] 插件 hotCatPlugin 已存在,跳过复制')
9
+ if (!existsSync(src)) {
10
+ console.log('[hotCatBot] 默认插件目录不存在,跳过')
11
11
  process.exit(0)
12
12
  }
13
13
 
14
- if (!existsSync(join(process.cwd(), 'plugins'))) {
15
- mkdirSync(join(process.cwd(), 'plugins'), { recursive: true })
14
+ if (existsSync(dest)) {
15
+ console.log('[hotCatBot] 插件 hotCatPlugin 已存在,跳过')
16
+ process.exit(0)
16
17
  }
17
18
 
19
+ mkdirSync(join(process.cwd(), 'plugins'), { recursive: true })
18
20
  cpSync(src, dest, { recursive: true })
19
- console.log('[hotCatBot] 默认插件 hotCatPlugin 已复制到 ./plugins/hotCatPlugin/')
21
+ console.log('[hotCatBot] 默认插件 hotCatPlugin 已创建 → ./plugins/hotCatPlugin/')