mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-08 17:57:05 +02:00
safety
This commit is contained in:
15
tools/copy-default-locale.js
Normal file
15
tools/copy-default-locale.js
Normal file
@@ -0,0 +1,15 @@
|
||||
var fs = require("fs-extra");
|
||||
var path = require("path");
|
||||
const BASEDIR = path.join(__dirname, "..");
|
||||
|
||||
// copy the en-GB content as default content
|
||||
fs.copySync(path.join(BASEDIR, "en-GB/index.html"), path.join(BASEDIR, "index.html"));
|
||||
fs.copySync(path.join(BASEDIR, "en-GB/article.js"), path.join(BASEDIR, "article.js"));
|
||||
|
||||
// make sure to remove the `<base>` tag from the index, and replace the JSX "className" with "class"
|
||||
var html = fs.readFileSync(path.join(BASEDIR, "index.html")).toString();
|
||||
html = html.replace(' <base href="..">\n', '');
|
||||
html = html.replace('className=', 'class=');
|
||||
html = html.replace('<script src="en-GB/article.js', '<script src="article.js');
|
||||
html = "<!-- AUTOGENERATED CONTENT, PLEASE EDIT 'index.template.html' INSTEAD! -->\n" + html;
|
||||
fs.writeFileSync(path.join(BASEDIR, "index.html"), html);
|
Reference in New Issue
Block a user