forked from smks/nobot-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.js
22 lines (20 loc) · 761 Bytes
/
setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const fse = require('fs-extra');
const path = require('path');
require('colors');
const configFiles = [
path.join('examples', '011', 'config.example.json'),
path.join('examples', '012', 'config.example.json'),
path.join('examples', '013', '.reminders.example.json'),
path.join('examples', '016', 'config.example.json'),
path.join('examples', '018', 'config.example.json'),
path.join('examples', '015', 'config.example.json'),
];
configFiles.map((configFileExample) => {
const newConfig = configFileExample.replace('.example', '');
if (fse.existsSync(newConfig)) {
return;
}
return fse.copy(configFileExample, newConfig)
.then(() => console.log(`Successfully created ${newConfig}`.green))
.catch(err => console.error(err));
});