yz-yuki-plugin 2.0.2-2 → 2.0.3-1
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/CHANGELOG.md +3 -0
- package/lib/apps/bilibili.js +1 -1
- package/lib/utils/config.d.ts +2 -2
- package/lib/utils/config.js +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/apps/bilibili.js
CHANGED
|
@@ -62,7 +62,7 @@ message.use(async (e) => {
|
|
|
62
62
|
}
|
|
63
63
|
const { has_more, items } = data || {};
|
|
64
64
|
if ((code === 0) && (has_more === false)) {
|
|
65
|
-
e.reply(
|
|
65
|
+
e.reply(`校验该up的主页空间动态内容为空\nup主uid:${uid} 可能是无效的,\n请核对uid或让该up发布一条动态后再试~`);
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
let name;
|
package/lib/utils/config.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import chokidar from "chokidar";
|
|
|
3
3
|
* Config 类用于管理配置文件的读取和监听
|
|
4
4
|
*/
|
|
5
5
|
declare class Config {
|
|
6
|
-
readonly
|
|
6
|
+
readonly packageJsonPath: string;
|
|
7
7
|
readonly defaultConfigPath: string;
|
|
8
8
|
readonly userConfigPath: string;
|
|
9
9
|
defaultConfig: Record<string, any>;
|
|
@@ -64,7 +64,7 @@ declare class Config {
|
|
|
64
64
|
* @param value 配置项的值
|
|
65
65
|
*/
|
|
66
66
|
updateConfigItem(appDir: string, functionName: string, key: string, value: any): void;
|
|
67
|
-
/** 读取
|
|
67
|
+
/** 读取package.json文件,获取最新版本号*/
|
|
68
68
|
getLatestVersion(): string | null;
|
|
69
69
|
}
|
|
70
70
|
declare const _default: Config;
|
package/lib/utils/config.js
CHANGED
|
@@ -9,14 +9,14 @@ import { _paths } from './paths.js';
|
|
|
9
9
|
* Config 类用于管理配置文件的读取和监听
|
|
10
10
|
*/
|
|
11
11
|
class Config {
|
|
12
|
-
|
|
12
|
+
packageJsonPath;
|
|
13
13
|
defaultConfigPath;
|
|
14
14
|
userConfigPath;
|
|
15
15
|
defaultConfig;
|
|
16
16
|
userConfig;
|
|
17
17
|
watcher;
|
|
18
18
|
constructor() {
|
|
19
|
-
this.
|
|
19
|
+
this.packageJsonPath = path.join(_paths.pluginPath, 'package.json');
|
|
20
20
|
/** 默认设置 */
|
|
21
21
|
this.defaultConfigPath = path.join(_paths.pluginPath, 'defaultConfig');
|
|
22
22
|
this.defaultConfig = {};
|
|
@@ -160,13 +160,13 @@ class Config {
|
|
|
160
160
|
config[key] = value; // 更新配置项
|
|
161
161
|
this.saveConfig("config", appDir, functionName, config); // 保存更新后的配置
|
|
162
162
|
}
|
|
163
|
-
/** 读取
|
|
163
|
+
/** 读取package.json文件,获取最新版本号*/
|
|
164
164
|
getLatestVersion() {
|
|
165
|
-
const content = fs.readFileSync(this.
|
|
166
|
-
const
|
|
167
|
-
const match =
|
|
165
|
+
const content = fs.readFileSync(this.packageJsonPath, 'utf-8');
|
|
166
|
+
const packageJson = JSON.parse(content);
|
|
167
|
+
const match = packageJson.version;
|
|
168
168
|
if (match) {
|
|
169
|
-
return match
|
|
169
|
+
return match;
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
172
172
|
return null;
|