This commit is contained in:
Max Leiter 2022-05-31 13:56:33 -07:00
parent 96aa50c673
commit 3d4d29bca4
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
5 changed files with 31 additions and 18 deletions

View file

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import log from "../log";
import colors from "chalk";
import semver from "semver";
@ -5,6 +6,13 @@ import Helper from "../helper";
import Config from "../config";
import Utils from "./utils";
import {Command} from "commander";
import {FullMetadata} from "package-json";
type CustomMetadata = FullMetadata & {
thelounge: {
supports: string;
};
};
const program = new Command("install");
program
@ -50,7 +58,7 @@ program
}
readFile
.then((json) => {
.then((json: CustomMetadata) => {
const humanVersion = isLocalFile ? packageName : `${json.name} v${json.version}`;
if (!("thelounge" in json)) {

View file

@ -8,9 +8,8 @@ program
.usage("list")
.description("List all users")
.on("--help", Utils.extraHelp)
.action(function () {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ClientManager = require("../../clientManager");
.action(async function () {
const ClientManager = (await import("../../clientManager")).default;
const users = new ClientManager().getUsers();
if (users === undefined) {

View file

@ -1,4 +1,5 @@
import Client from "../../client";
import log from "../../log";
import Chan, {Channel} from "../../models/chan";
import Network, {NetworkWithIrcFramework} from "../../models/network";
import {PackageInfo} from "../packages";
@ -59,19 +60,23 @@ const builtInInputs = [
];
for (const input of builtInInputs) {
import(`./${input}`).then(
(plugin: {
default: {
commands: string[];
input: (network: Network, chan: Chan, cmd: string, args: string[]) => void;
allowDisconnected?: boolean;
};
}) => {
plugin.default.commands.forEach((command: string) =>
userInputs.set(command, plugin.default)
);
}
);
import(`./${input}`)
.then(
(plugin: {
default: {
commands: string[];
input: (network: Network, chan: Chan, cmd: string, args: string[]) => void;
allowDisconnected?: boolean;
};
}) => {
plugin.default.commands.forEach((command: string) =>
userInputs.set(command, plugin.default)
);
}
)
.catch((err) => {
log.error(err);
});
}
// .reduce(async function (plugins, name) {

View file

@ -3,6 +3,6 @@
"host": "irc.example.com",
"port": 7000,
"duration": 3600,
"expires": 1654033556780
"expires": 1654033745673
}
]

View file

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-empty-function */
"use strict";
import {expect} from "chai";