Skip to content

Commit

Permalink
Bump version 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Jan 19, 2021
1 parent e5a6890 commit c15b699
Show file tree
Hide file tree
Showing 5 changed files with 425 additions and 526 deletions.
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ jobs:
- run: yarn run build
- run: yarn run cli:install
- run: broker
- run: broker help gh
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,20 @@ As CLI:

```bash
$ broker
Usage: broker [subcommand] [options]

CLI tool for distribute webpages to Wayback Machine.

Options:
-v, --version output the current version
-h, --help display help for command

Commands:
github|gh [options] Distribute webpages to GitHub repository.
duty-machine|duty [options] Distribute webpages to duty-machine.
help [command] display help for command

$ broker help gh
Usage: broker github|gh [options]

Distribute webpages to GitHub repository.
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wabarc/broker",
"version": "0.3.0",
"version": "0.3.1",
"description": "Pack and store webpages from Telegram channel.",
"main": "./dist/index.js",
"types": "./dist/type.d.ts",
Expand Down Expand Up @@ -37,14 +37,14 @@
"@octokit/rest": "^18.0.12",
"@wabarc/packer": "^0.1.2",
"axios": "^0.21.1",
"commander": "^6.2.1"
"commander": "^7.0.0"
},
"devDependencies": {
"@octokit/types": "^6.2.1",
"@octokit/types": "^6.3.2",
"@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"@typescript-eslint/parser": "^4.12.0",
"eslint": "^7.17.0",
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0",
"eslint": "^7.18.0",
"eslint-plugin-jest": "^24.1.3",
"jest": "^26.6.3",
"prettier": "^2.2.1",
Expand Down
19 changes: 9 additions & 10 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import { Broker } from './broker';
async function github(cmd) {
const { token, owner, repo, channel, limit } = cmd;
if (!token || !owner || !repo || !channel) {
cmd.help();
process.exit(0);
}

console.info('broking to GitHub...');
console.info('Broking to GitHub...');

const broker = new Broker()
.source({ channel: channel, limit: process.env.BROKER_MSG_LIMIT || limit })
Expand All @@ -21,11 +20,10 @@ async function github(cmd) {
async function dutyMachine(cmd) {
const { token, owner, repo, channel, limit } = cmd;
if (!token || !owner || !repo || !channel) {
cmd.help();
process.exit(0);
}

console.info('broking to duty-machine...');
console.info('Broking to duty-machine...');

new Broker()
.source({ channel: channel, limit: process.env.BROKER_MSG_LIMIT || limit })
Expand All @@ -41,12 +39,6 @@ const main = async () => {
return parseInt(v);
};

program
.name('broker')
.usage('[subcommand] [options]')
.version('0.1.0', '-v, --version', 'output the current version')
.description('CLI tool for distribute webpages to Wayback Machine.');

program
.command('github', { isDefault: true })
.alias('gh')
Expand All @@ -72,6 +64,13 @@ const main = async () => {
.option('-l, --limit [number]', 'fetch message limit one time', toInt, 25)
.action(dutyMachine);

program
.name('broker')
.usage('[subcommand] [options]')
.version('0.1.0', '-v, --version', 'output the current version')
.description('CLI tool for distribute webpages to Wayback Machine.')
.outputHelp();

await program.parseAsync(process.argv);
};

Expand Down
Loading

0 comments on commit c15b699

Please sign in to comment.