Compare commits
No commits in common. "8e5b9d2bc6f258f435842d03ed7ad925ffb8e8c1" and "647dc9a2ec9fce5ddfe93b4dc90e2a0e1538e1fa" have entirely different histories.
8e5b9d2bc6
...
647dc9a2ec
|
@ -134,10 +134,9 @@ class Config {
|
|||
saveConfigJson(file, data) {
|
||||
(0, bsert_1.default)(typeof data === "object");
|
||||
(0, bsert_1.default)(!Array.isArray(data));
|
||||
const configDir = this.str("configdir");
|
||||
const fullPath = path_1.default.join(configDir, file);
|
||||
if (!fs_1.default.existsSync(configDir)) {
|
||||
fs_1.default.mkdirSync(configDir, { recursive: true });
|
||||
const fullPath = path_1.default.join(this.str("configdir"), file);
|
||||
if (!fs_1.default.existsSync(fullPath)) {
|
||||
fs_1.default.mkdirSync(fullPath, { recursive: true });
|
||||
}
|
||||
fs_1.default.writeFileSync(fullPath, JSON.stringify(data));
|
||||
this.openJson(fullPath);
|
||||
|
|
|
@ -173,11 +173,10 @@ export default class Config {
|
|||
assert(typeof data === "object");
|
||||
assert(!Array.isArray(data));
|
||||
|
||||
const configDir = this.str("configdir");
|
||||
const fullPath = Path.join(configDir, file);
|
||||
const fullPath = Path.join(this.str("configdir"), file);
|
||||
|
||||
if (!fs.existsSync(configDir)) {
|
||||
fs.mkdirSync(configDir, { recursive: true });
|
||||
if (!fs.existsSync(fullPath)) {
|
||||
fs.mkdirSync(fullPath, { recursive: true });
|
||||
}
|
||||
|
||||
fs.writeFileSync(fullPath, JSON.stringify(data));
|
||||
|
|
Loading…
Reference in New Issue