mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Copy from example if not exist
This commit is contained in:
@@ -10,6 +10,15 @@ class Configuration {
|
|||||||
if (!fs.existsSync(dir)) {
|
if (!fs.existsSync(dir)) {
|
||||||
fs.mkdirSync(dir);
|
fs.mkdirSync(dir);
|
||||||
}
|
}
|
||||||
|
this.copyExampleIfNotExists("Ping.json");
|
||||||
|
this.copyExampleIfNotExists("ServiceAnnouncement.json");
|
||||||
|
}
|
||||||
|
|
||||||
|
private copyExampleIfNotExists(file: string): void {
|
||||||
|
const dir = path.join(process.cwd(), 'configs/');
|
||||||
|
if (!fs.existsSync(path.join(dir, file))) {
|
||||||
|
fs.copyFileSync(path.join(process.cwd(), 'configs/', `${file.replace('.json', '.example.json')}`), path.join(dir, file));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Make a real providers like Environment
|
// TODO: Make a real providers like Environment
|
||||||
|
|||||||
Reference in New Issue
Block a user