mm_config 2.2.4 → 2.2.6
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/index.js +6 -2
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -288,7 +288,9 @@ Config.prototype.destroy = function () {
|
|
|
288
288
|
function create(file, options = {}, config = {}) {
|
|
289
289
|
let f = file.fullname();
|
|
290
290
|
let cfg = new Config({ file: f, ...config }, options);
|
|
291
|
-
|
|
291
|
+
if (!file.hasFile()) {
|
|
292
|
+
cfg.saveSync(); // 确保文件存在
|
|
293
|
+
}
|
|
292
294
|
// 注册配置字典
|
|
293
295
|
dict[f] = cfg;
|
|
294
296
|
return dict[f].getProxy();
|
|
@@ -304,7 +306,9 @@ function create(file, options = {}, config = {}) {
|
|
|
304
306
|
async function createAsync(file, options = {}, config = {}) {
|
|
305
307
|
let f = file.fullname();
|
|
306
308
|
let cfg = new Config({ file: f, ...config }, options);
|
|
307
|
-
|
|
309
|
+
if (!file.hasFile()) {
|
|
310
|
+
await cfg.saveAsync(); // 确保文件存在
|
|
311
|
+
}
|
|
308
312
|
// 注册配置字典
|
|
309
313
|
dict[f] = cfg;
|
|
310
314
|
return dict[f].getAsyncProxy();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_config",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "Super Meimei Configuration Synchronizer - Automatically sync configuration changes to JSON files",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"LICENSE"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"mm_expand": "^2.0.
|
|
43
|
+
"mm_expand": "^2.0.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"eslint": "^
|
|
47
|
-
"eslint-plugin-jsdoc": "^62.
|
|
48
|
-
"mm_eslint": "^1.
|
|
46
|
+
"eslint": "^10.1.0",
|
|
47
|
+
"eslint-plugin-jsdoc": "^62.8.1",
|
|
48
|
+
"mm_eslint": "^1.7.1"
|
|
49
49
|
}
|
|
50
50
|
}
|