@karinjs/adapter-qqbot 1.0.1 → 1.0.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.
- package/README.md +5 -0
- package/lib/utils/dir.d.ts +1 -1
- package/lib/utils/dir.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/utils/dir.d.ts
CHANGED
package/lib/utils/dir.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
1
2
|
import path from 'path';
|
|
2
3
|
import { fileURLToPath } from 'url';
|
|
3
4
|
/** 当前文件的绝对路径 */
|
|
@@ -5,5 +6,5 @@ const filePath = fileURLToPath(import.meta.url).replace(/\\/g, '/');
|
|
|
5
6
|
/** 插件包绝对路径 */
|
|
6
7
|
const dirPath = path.resolve(filePath, '../../../');
|
|
7
8
|
/** 插件包的名称 */
|
|
8
|
-
const basename =
|
|
9
|
+
const basename = JSON.parse(fs.readFileSync(`${dirPath}/package.json`, 'utf-8')).name;
|
|
9
10
|
export { dirPath, basename };
|