Skip to content

Commit

Permalink
Don't remove outDir if it doesn't exist (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
suchipi committed Oct 1, 2020
1 parent a69e68e commit 869fb7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ args.push("posthtml-md2html");
args.push("--posthtml-md2html.gfm");
args.push("true");

fs.rmdirSync(outDir, { recursive: true });
if (fs.existsSync(outDir)) {
fs.rmdirSync(outDir, { recursive: true });
}

const htmlOnlyIndex = args.findIndex((a) => a === "-x" || a === "--htmlOnly");
const run =
Expand Down

0 comments on commit 869fb7f

Please sign in to comment.