Skip to content

Commit 8a06377

Browse files
committed
fix banner check
1 parent 890e27e commit 8a06377

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

banner.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require("fs");
22
const pkg = require("./package.json");
33
const filename = "assets/js/main.min.js";
4-
const script = fs.readFileSync(filename);
4+
const script = fs.readFileSync(filename, 'utf8');
55
const padStart = str => ("0" + str).slice(-2);
66
const dateObj = new Date();
77
const date = `${dateObj.getFullYear()}-${padStart(
@@ -14,6 +14,6 @@ const banner = `/*!
1414
*/
1515
`;
1616

17-
if (script.slice(0, 3) != "/**") {
17+
if (!script.startsWith('/*!')) {
1818
fs.writeFileSync(filename, banner + script);
1919
}

0 commit comments

Comments
 (0)