mirror of
https://github.com/thelounge/thelounge
synced 2024-11-28 15:00:37 +00:00
Merge pull request #4856 from thelounge/generateConfigDoc
fix generate-config-doc.js
This commit is contained in:
commit
549c445853
1 changed files with 26 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue