()
| 14 | } |
| 15 | |
| 16 | function cleanBuildFolder(){ |
| 17 | console.log(chalk.yellow(`Cleaning up build directory`)); |
| 18 | fs.readdir(TUTORIAL_BUILD_PATH, function (err, items) { |
| 19 | items.forEach(function(file) { |
| 20 | var filePath = path.join(TUTORIAL_BUILD_PATH, file); |
| 21 | fs.unlink(filePath, function(err) { |
| 22 | if (err) { |
| 23 | console.log(chalk.red(`Error when deleting file %s`), filePath); |
| 24 | throw new Error(err); |
| 25 | } |
| 26 | }) |
| 27 | }) |
| 28 | }); |
| 29 | } |
| 30 | |
| 31 | |
| 32 | function createJSFilesFromMarkdown(){ |