Skip to content

Commit

Permalink
comment www script
Browse files Browse the repository at this point in the history
  • Loading branch information
1cg committed Apr 11, 2023
1 parent ae47c7b commit 9162262
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/www.js
Expand Up @@ -6,6 +6,8 @@ console.log(config.version)
var testRoot = "www/static/test/";
var currentReleaseRoot = testRoot + config.version;
fs.ensureDirSync(currentReleaseRoot);

// copy over all test support files
fs.copySync("node_modules/mocha/mocha.js", currentReleaseRoot + "/node_modules/mocha/mocha.js");
fs.copySync("node_modules/mocha/mocha.css", currentReleaseRoot + "/node_modules/mocha/mocha.css");
fs.copySync("node_modules/chai/chai.js", currentReleaseRoot + "/node_modules/chai/chai.js");
Expand All @@ -14,10 +16,8 @@ fs.copySync("node_modules/sinon/pkg/sinon.js", currentReleaseRoot + "/node_modul
fs.copySync("node_modules/mock-socket/dist/mock-socket.js", currentReleaseRoot + "/node_modules/mock-socket/dist/mock-socket.js");
fs.copySync("test/", currentReleaseRoot + "/test");
fs.copySync("src/", currentReleaseRoot + "/src");
fs.copySync("src/htmx.js", "www/themes/htmx-theme/static/js/htmx.js");
fs.copySync("src/ext/class-tools.js", "www/themes/htmx-theme/static/js/class-tools.js");
fs.copySync("src/ext/preload.js", "www/themes/htmx-theme/static/js/preload.js");

// update the test index file to include a link for all releases
var testHTML = "<html><body style='font-family: sans-serif'><h1>HTMX TESTS</h1><ul>\n"
fs.readdirSync(testRoot).reverse().forEach(function (file) {
if (file !== "index.html") {
Expand All @@ -26,3 +26,8 @@ fs.readdirSync(testRoot).reverse().forEach(function (file) {
});
testHTML += "</ul></body>"
fs.writeFileSync(testRoot + "/index.html", testHTML);

// copy the current htmx to the main website
fs.copySync("src/htmx.js", "www/themes/htmx-theme/static/js/htmx.js");
fs.copySync("src/ext/class-tools.js", "www/themes/htmx-theme/static/js/class-tools.js");
fs.copySync("src/ext/preload.js", "www/themes/htmx-theme/static/js/preload.js");

0 comments on commit 9162262

Please sign in to comment.