Skip to content

Commit

Permalink
Clear the "generated" directory each run
Browse files Browse the repository at this point in the history
This avoids stray files getting published, thus closing #1773.
  • Loading branch information
domenic committed Apr 29, 2017
1 parent ca8dfef commit 8c1709b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Empty file.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"optimist": "0.6.1",
"portfinder": "^1.0.13",
"q": "^1.4.1",
"rimraf": "^2.6.1",
"selenium-standalone": "^6.0.1",
"server-destroy": "^1.0.1",
"st": "^1.2.0",
Expand Down
11 changes: 10 additions & 1 deletion scripts/webidl/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"use strict";

const path = require("path");
const fs = require("fs");
const rimraf = require("rimraf");

const Webidl2js = require("webidl2js");

Expand All @@ -26,7 +28,14 @@ addDir("../../lib/jsdom/living/file-api");
addDir("../../lib/jsdom/living/xhr");
addDir("../../lib/jsdom/living/domparsing");

transformer.generate(path.resolve(__dirname, "../../lib/jsdom/living/generated/"))

const outputDir = path.resolve(__dirname, "../../lib/jsdom/living/generated/");

// Clean up any old stuff lying around.
rimraf.sync(outputDir);
fs.mkdirSync(outputDir);

transformer.generate(outputDir)
.catch(err => {
console.error(err);
process.exit(1);
Expand Down

0 comments on commit 8c1709b

Please sign in to comment.