From 9841b7d57174e69580fa104d6fdce3661a3fd501 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 28 Nov 2020 22:26:42 +0200 Subject: [PATCH] tslint --- .npmignore | 4 ++++ package.json | 5 +++-- src/cli.ts | 18 +++++++++--------- src/core.ts | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..42bdaa6 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +/src/ +/tsconfig.json +/tsconfig.tsbuildinfo +/tslint.json \ No newline at end of file diff --git a/package.json b/package.json index 220bf66..04e68a7 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/cli.ts b/src/cli.ts index 6d71ebf..b7184ca 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -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 { } }); } -} \ No newline at end of file +} diff --git a/src/core.ts b/src/core.ts index e319acd..1543ec2 100644 --- a/src/core.ts +++ b/src/core.ts @@ -31,7 +31,7 @@ export class Squeebot { this.stream, this.environment, this.npm); - + public repositoryManager: RepositoryManager = new RepositoryManager( this.environment, this.pluginManager,