Merge pull request #4717 from thelounge/changelog

Inline logger into changelog script
This commit is contained in:
Max Leiter 2023-03-20 13:53:41 -07:00 committed by GitHub
commit b408843ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,13 +53,38 @@ const got = require("got");
const dayjs = require("dayjs");
const semver = require("semver");
const util = require("util");
const log = require("../server/log");
const packageJson = require("../package.json");
let token = process.env.CHANGELOG_TOKEN;
const readFile = util.promisify(fs.readFile);
const writeFile = util.promisify(fs.writeFile);
function timestamp() {
const datetime = new Date().toISOString().split(".")[0].replace("T", " ");
return colors.dim(datetime);
}
const log = {
/* eslint-disable no-console */
error(...args) {
console.error(timestamp(), colors.red("[ERROR]"), ...args);
},
warn(...args) {
console.error(timestamp(), colors.yellow("[WARN]"), ...args);
},
info(...args) {
console.log(timestamp(), colors.blue("[INFO]"), ...args);
},
debug(...args) {
console.log(timestamp(), colors.green("[DEBUG]"), ...args);
},
raw(...args) {
console.log(...args);
},
/* eslint-enable no-console */
};
const changelogPath = path.resolve(__dirname, "..", "CHANGELOG.md");
// CLI argument validations