mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-08 00:32:19 +02:00
fix generate-config-doc.js
It errored out with > Error: Cannot find module '../server/log' Which is expected, but we don't really need it, we can just open code the log functions
This commit is contained in:
parent
f5867c3643
commit
2466c1b1e4
|
@ -10,10 +10,35 @@
|
||||||
|
|
||||||
const {readFileSync, writeFileSync} = require("fs");
|
const {readFileSync, writeFileSync} = require("fs");
|
||||||
const colors = require("chalk");
|
const colors = require("chalk");
|
||||||
const log = require("../server/log").default;
|
|
||||||
const {join} = require("path");
|
const {join} = require("path");
|
||||||
const {spawnSync} = require("child_process");
|
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() {
|
function getGitUsername() {
|
||||||
return spawnSync("git", ["config", "user.name"], {encoding: "utf8"}).stdout.trim();
|
return spawnSync("git", ["config", "user.name"], {encoding: "utf8"}).stdout.trim();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue