forked from mnmxmx/raymarching-study
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkconfig.js
More file actions
38 lines (27 loc) · 720 Bytes
/
mkconfig.js
File metadata and controls
38 lines (27 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const fs = require('file-system');
var config = {
files: []
};
function getInfo (callback) {
fs.readdir('./js/', (err, files) => {
files.forEach(file => {
if(file !== '.DS_Store' && file !== "common" && file !== "utils") {
config.files.push(file);
}
});
callback();
});
}
function setInfo() {
var filepath_1 = "./config.js";
var fileContent_1 = 'module.exports = ' + JSON.stringify(config);
fs.writeFile(filepath_1, fileContent_1, (err) => {
if (err) throw err;
});
var filepath_2 = "./dist/config.json";
var fileContent_2 = JSON.stringify(config);
fs.writeFile(filepath_2, fileContent_2, (err) => {
if (err) throw err;
});
}
getInfo(setInfo);