This commit is contained in:
Evert Prants 2020-11-28 22:26:42 +02:00
parent 037ccb62c4
commit 9841b7d571
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
4 changed files with 17 additions and 12 deletions

4
.npmignore Normal file
View File

@ -0,0 +1,4 @@
/src/
/tsconfig.json
/tsconfig.tsbuildinfo
/tslint.json

View File

@ -2,7 +2,7 @@
"name": "@squeebot/cli",
"version": "3.0.0",
"description": "Squeebot v3 runtime, environments and configuration",
"main": "index.js",
"main": "dist/squeebot.js",
"bin": {
"squeebot": "./dist/squeebot.js",
"squeebotd": "./dist/squeebotd.js"
@ -11,7 +11,8 @@
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc",
"watch": "tsc -w",
"start": "node ./dist/squeebot"
"start": "node ./dist/squeebot",
"prepare": "npm run build"
},
"repository": {
"type": "git",

View File

@ -50,7 +50,7 @@ export class SqueebotCLI {
for (const namep of args.slice(1)) {
await this.bot.repositoryManager.uninstallRepository(namep);
logger.log('Installed repository %s.', namep);
};
}
break;
case 'u':
case 'upd':
@ -62,7 +62,7 @@ export class SqueebotCLI {
}
return;
}
for (const namep of args.slice(1)) {
const repo = this.bot.repositoryManager.getRepoByName(namep);
if (!repo) {
@ -71,7 +71,7 @@ export class SqueebotCLI {
}
await this.checkUpdate(repo);
};
}
break;
default:
logger.log(help);
@ -99,7 +99,7 @@ export class SqueebotCLI {
case 'remove':
case 'uninstall':
for (const name of args.slice(1)) {
await this.bot.repositoryManager.uninstallPlugin(name)
await this.bot.repositoryManager.uninstallPlugin(name);
logger.log('Uninstalled plugin %s.', name);
}
break;
@ -135,7 +135,7 @@ export class SqueebotCLI {
}
logger.log('Stopping plugin', name);
this.bot.stream.emitTo(name, 'pluginUnload', name);
}
break;
@ -193,7 +193,7 @@ export class SqueebotCLI {
return;
}
switch(args[0]) {
switch (args[0]) {
case 'new':
if (this.bot.channelManager.getChannelByName(args[1])) {
logger.error('A channel by that name already exists!');
@ -303,7 +303,7 @@ export class SqueebotCLI {
await this.bot.config.save();
}
public attach(rl: ReadLine) {
public attach(rl: ReadLine): void {
rl.on('line', (line: string) => {
const split = line.split(' ');
@ -311,7 +311,7 @@ export class SqueebotCLI {
return;
}
switch(split[0]) {
switch (split[0]) {
case 'r':
case 'repo':
case 'repository':
@ -339,4 +339,4 @@ export class SqueebotCLI {
}
});
}
}
}

View File

@ -31,7 +31,7 @@ export class Squeebot {
this.stream,
this.environment,
this.npm);
public repositoryManager: RepositoryManager = new RepositoryManager(
this.environment,
this.pluginManager,