feat(config): allow more config file names

.rczrc.json and rcz.config.json can now be used as rcz configuration
This commit is contained in:
2023-08-22 17:28:21 +03:00
parent 56ad837b82
commit 5080d71fb8
3 changed files with 15 additions and 2 deletions

View File

@@ -24,6 +24,18 @@ const GetConfig = async () => {
await fs.promises.readFile(path.join(process.cwd(), ".rczrc"))
).toString()
) as Config;
} else if (fs.existsSync(path.join(process.cwd(), ".rczrc.json"))) {
return JSON.parse(
(
await fs.promises.readFile(path.join(process.cwd(), ".rczrc.json"))
).toString()
) as Config;
} else if (fs.existsSync(path.join(process.cwd(), "rcz.config.json"))) {
return JSON.parse(
(
await fs.promises.readFile(path.join(process.cwd(), "rcz.config.json"))
).toString()
) as Config;
} else {
return null;
}