(dir, filename, content, cb)
| 5 | const CONFIG_PATH = path.resolve(__dirname, '../runtime/config'); |
| 6 | |
| 7 | function createFile(dir, filename, content, cb) { |
| 8 | if (!fs.existsSync(dir)) { |
| 9 | mkdirp.sync(dir); |
| 10 | } |
| 11 | let filePath = path.join(dir, filename); |
| 12 | fs.openSync(filePath, 'w'); |
| 13 | if (content) { |
| 14 | fs.writeFile(filePath, content, cb); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | function touchConfig(config = {}, cb) { |
| 19 | let json = JSON.stringify(config,function(key, val) { |
no outgoing calls
no test coverage detected
searching dependent graphs…