/
kopython
/
_hyperscript
Обзор
Документация
Войти
/
kopython
/
_hyperscript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
scripts/www.js
24 строки
1 KB
Carson Gross
0.9.7 release - improved release
18 июл 2022, 22:38
18 июл 2022, 22:38
c61b884
Код
Авторство
О чём код?
var config = require('../package.json'); var fs = require('fs-extra'); var testRoot = "www/test/"; var currentReleaseRoot = testRoot + config.version; fs.ensureDirSync(currentReleaseRoot); 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"); fs.copySync("node_modules/sinon/pkg/sinon.js", currentReleaseRoot + "/node_modules/sinon/pkg/sinon.js"); fs.copySync("test/", currentReleaseRoot + "/test"); fs.copySync("src/", currentReleaseRoot + "/src"); fs.copySync("dist/", currentReleaseRoot + "/dist"); fs.copySync("dist/_hyperscript.min.js", "www/js/_hyperscript.min.js"); fs.copySync("dist/hdb.min.js", "www/js/hdb.min.js"); var testHTML = "<html><body style='font-family: sans-serif'><h1>Hyperscript RELEASE TESTS</h1><ul>\n" fs.readdirSync(testRoot).reverse().forEach(function(file){ if (file !== "index.html") { testHTML += "<li><a href='/test/" + file + "/test'>" + file + "</a>\n"; } }); testHTML += "</ul></body>" fs.writeFileSync(testRoot + "/index.html", testHTML);