Skip to content

Commit

Permalink
Merge pull request #4856 from thelounge/generateConfigDoc
Browse files Browse the repository at this point in the history
fix generate-config-doc.js
  • Loading branch information
MaxLeiter committed Apr 8, 2024
2 parents f5867c3 + 2466c1b commit 549c445
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion scripts/generate-config-doc.js
Expand Up @@ -10,10 +10,35 @@

const {readFileSync, writeFileSync} = require("fs");
const colors = require("chalk");
const log = require("../server/log").default;
const {join} = require("path");
const {spawnSync} = require("child_process");

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 */
};

function getGitUsername() {
return spawnSync("git", ["config", "user.name"], {encoding: "utf8"}).stdout.trim();
}
Expand Down

0 comments on commit 549c445

Please sign in to comment.