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