diff --git a/lib/cli.js b/lib/cli.js index 91964b3a..8433488c 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -160,7 +160,7 @@ function buildWatcherOptions(options) { function guardOutputDir(outputDir, overwrite) { if (fs.existsSync(outputDir)) { if (overwrite) { - if (!canDeleteOutputPath(outputDir)) { + if (!isParentDirectory(outputDir)) { console.error( 'option --overwrite can not be used if outputPath is a parent directory: ' + outputDir ); @@ -177,7 +177,7 @@ function guardOutputDir(outputDir, overwrite) { } } -function canDeleteOutputPath(outputPath) { +function isParentDirectory(outputPath) { outputPath = fs.realpathSync(outputPath); const rootPath = process.cwd();