Skip to content

Commit

Permalink
chore: log error when set outDir to cwd (close: #322) (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaodahong authored and ulivz committed May 2, 2018
1 parent fefa16c commit f4de118
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = async function build (sourceDir, cliOptions = {}) {
}

const { outDir } = options
if (path.resolve() === outDir) {
return console.error(chalk.red('Unexpected option: outDir cannot be set to the current working directory.\n'))
}
await fs.remove(outDir)

let clientConfig = createClientConfig(options, cliOptions).toConfig()
Expand Down

0 comments on commit f4de118

Please sign in to comment.