Guide_3DS/banner.js

20 lines
634 B
JavaScript
Raw Normal View History

const fs = require("fs");
const pkg = require("./package.json");
const filename = "assets/js/main.min.js";
2017-09-28 23:42:38 +02:00
const script = fs.readFileSync(filename);
const padStart = str => ("0" + str).slice(-2);
const dateObj = new Date();
const date = `${dateObj.getFullYear()}-${padStart(
dateObj.getMonth() + 1
)}-${padStart(dateObj.getDate())}`;
2017-09-28 23:42:38 +02:00
const banner = `/*!
* Minimal Mistakes Jekyll Theme ${pkg.version} by ${pkg.author}
* Copyright 2013-${dateObj.getFullYear()} Michael Rose - mademistakes.com | @mmistakes
2017-09-28 23:42:38 +02:00
* Licensed under ${pkg.license}
*/
`;
if (script.slice(0, 3) != "/**") {
2017-09-28 23:42:38 +02:00
fs.writeFileSync(filename, banner + script);
}