Skip to content

Commit

Permalink
isParentDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
oligriffiths committed Mar 20, 2018
1 parent 71e9d22 commit c4cfc14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -177,7 +177,7 @@ function guardOutputDir(outputDir, overwrite) {
}
}

function canDeleteOutputPath(outputPath) {
function isParentDirectory(outputPath) {
outputPath = fs.realpathSync(outputPath);

const rootPath = process.cwd();
Expand Down

0 comments on commit c4cfc14

Please sign in to comment.