feat($core): emit warning if the source directory doesn't exist (close: #1521)

This commit is contained in:
ULIVZ
2019-04-07 01:08:05 +08:00
parent 74887c50da
commit 6da9a5f112
+3
View File
@@ -41,6 +41,9 @@ module.exports = class App {
this.options = options
this.sourceDir = this.options.sourceDir || path.join(__dirname, 'docs.fallback')
logger.debug('sourceDir', this.sourceDir)
if (!fs.existsSync(this.sourceDir)) {
logger.warn(`Source directory doesn't exist: ${chalk.yellow(this.sourceDir)}`)
}
const { tempPath, writeTemp } = createTemp(options.temp)
this.tempPath = tempPath