*Do mkdir on just configdir

This commit is contained in:
Derrick Hammer 2022-12-06 16:48:30 -05:00
parent 647dc9a2ec
commit 6e37b22988
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 3 deletions

View File

@ -173,10 +173,11 @@ export default class Config {
assert(typeof data === "object");
assert(!Array.isArray(data));
const fullPath = Path.join(this.str("configdir"), file);
const configDir = this.str("configdir");
const fullPath = Path.join(configDir, file);
if (!fs.existsSync(fullPath)) {
fs.mkdirSync(fullPath, { recursive: true });
if (!fs.existsSync(configDir)) {
fs.mkdirSync(configDir, { recursive: true });
}
fs.writeFileSync(fullPath, JSON.stringify(data));