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:
12
src/index.ts
12
src/index.ts
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user