thelounge/server/command-line/start.ts
Tiago de Paula d146d51a95
chore(deps): update typescript-eslint to v8
Changes:
- `no-var-requires` replaced by `no-require-imports` (typescript-eslint/typescript-eslint#8334)
- `restrict-template-expressions` does not trigger for `Error` (typescript-eslint/typescript-eslint#8556)
- `only-throw-error` and `prefer-promise-reject-errors` recommended (typescript-eslint/typescript-eslint#9079)
- fixed `no-base-to-string` in client/js/upload.ts
- fixed `no-unsafe-enum-comparison` in client/js/store.ts
- fixed `await-thenable` in  test/client/js/helpers/parse.ts
- fixed `no-empty-object-type` in client/shims-vue.d.ts and shared/types/socket-events.d.ts

See <https://typescript-eslint.io/blog/announcing-typescript-eslint-v8/>
2026-01-31 17:59:11 -03:00

37 lines
1.1 KiB
TypeScript

import log from "../log";
import colors from "chalk";
import fs from "fs";
import path from "path";
import {Command} from "commander";
import Config from "../config";
import Utils from "./utils";
const program = new Command("start");
program
.description("Start the server")
.option("--dev", "Development mode with hot module reloading")
.on("--help", Utils.extraHelp)
.action(function (options) {
initalizeConfig();
const newLocal = "../server";
// eslint-disable-next-line @typescript-eslint/no-require-imports
const server = require(newLocal);
server.default(options);
});
function initalizeConfig() {
if (!fs.existsSync(Config.getConfigPath())) {
fs.mkdirSync(Config.getHomePath(), {recursive: true});
fs.chmodSync(Config.getHomePath(), "0700");
fs.copyFileSync(
path.resolve(path.join(__dirname, "..", "..", "defaults", "config.js")),
Config.getConfigPath()
);
log.info(`Configuration file created at ${colors.green(Config.getConfigPath())}.`);
}
fs.mkdirSync(Config.getUsersPath(), {recursive: true, mode: 0o700});
}
export default program;