@oxiaom/adoremix 1.0.32 → 1.0.33
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 +1 -1
- package/src/config/ini.js +3 -0
package/package.json
CHANGED
package/src/config/ini.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
4
5
|
const ini = require('ini');
|
|
5
6
|
|
|
6
7
|
function read(configPath) {
|
|
@@ -10,6 +11,8 @@ function read(configPath) {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
function write(configPath, obj) {
|
|
14
|
+
// 工作目录可能被 uninstall --purge 删掉,写 config.ini 前确保父目录存在
|
|
15
|
+
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
13
16
|
const txt = ini.stringify(obj, {
|
|
14
17
|
section: '',
|
|
15
18
|
whitespace: true,
|