mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-02-24 09:33:19 +01:00
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
var fs = require("fs-extra");
|
|
var glob = require("glob");
|
|
var path = require("path");
|
|
var findLocales = require("./find-locales");
|
|
var fileNames = ["index.html", "article.js"];
|
|
|
|
const BASEDIR = path.join(__dirname, "..");
|
|
|
|
console.log("Copying files to over for deployment...");
|
|
|
|
// copy all content over
|
|
findLocales(locales => {
|
|
locales.forEach(locale => {
|
|
console.log(`Copying ${locale}`);
|
|
fileNames.forEach(filename => {
|
|
fs.copySync(path.join(BASEDIR, locale, filename), path.join(BASEDIR, "..", "bezierinfo", locale, filename));
|
|
})
|
|
})
|
|
|
|
// copy over all SVG images
|
|
console.log(`Copying images`);
|
|
glob(path.join(BASEDIR,"images", "latex", "*.svg"), (err, files) => {
|
|
files.forEach( file => {
|
|
fs.copySync(file, path.join(BASEDIR, "..", "bezierinfo", "images", "latex", path.basename(file)));
|
|
});
|
|
|
|
// copy the compiled CSS
|
|
console.log(`Copying style.css`);
|
|
fs.copySync(path.join(BASEDIR, "stylesheets", "style.css"), path.join(BASEDIR, "..", "bezierinfo", "stylesheets", "style.css"));
|
|
|
|
// copy the base article.js as well
|
|
console.log(`Copying default article.js`);
|
|
fs.copySync(path.join(BASEDIR, "article.js"), path.join(BASEDIR, "..", "bezierinfo", "article.js"));
|
|
|
|
console.log(`Deploy copy complete.`);
|
|
});
|
|
});
|