Skip to content

Commit

Permalink
Update dependency yargs to v17 (#217)
Browse files Browse the repository at this point in the history
* Update dependency yargs to v17

* Update dependency yargs to v17

* Use async parse to perserve behavior

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mark Tutkowski <mark@tutkowski.com>
  • Loading branch information
3 people committed Jul 26, 2021
1 parent f72b3f3 commit d56808e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 13 deletions.
56 changes: 50 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -39,7 +39,7 @@
"rxjs": "7.2.0",
"soundcloud.ts": "0.4.0",
"tmp-promise": "3.0.2",
"yargs": "16.2.0",
"yargs": "17.0.1",
"ytdl-core": "4.9.0"
},
"devDependencies": {
Expand All @@ -52,7 +52,7 @@
"@types/node-schedule": "1.3.2",
"@types/tmp": "0.2.1",
"@types/ws": "7.4.7",
"@types/yargs": "15.0.5",
"@types/yargs": "17.0.2",
"@typescript-eslint/eslint-plugin": "4.28.4",
"@typescript-eslint/parser": "4.28.4",
"eslint": "7.31.0",
Expand Down
4 changes: 2 additions & 2 deletions src/meme/meme.ts
Expand Up @@ -40,7 +40,7 @@ export class Meme {

const args = yargs.options({
template: { type: 'string' },
}).parse(msg.content);
}).parseSync(msg.content);

const template = this.findTemplate(args.template);
return `${template.name} boxes ${template.box_count}`;
Expand All @@ -57,7 +57,7 @@ export class Meme {
box4: { type: 'string' },
box5: { type: 'string' },
box6: { type: 'string' },
}).parse(msg.content);
}).parseSync(msg.content);

let captions = [
args.box1,
Expand Down
7 changes: 4 additions & 3 deletions src/play/play.ts
Expand Up @@ -55,11 +55,12 @@ export class Play {
.options({
url: { type: 'string', default: 'https://youtu.be/dQw4w9WgXcQ' },
volume: { type: 'number', alias: 'v', default: '100' },
}).parse(msg.content);
}).parseSync(msg.content);

// If the url is provided as the last arg (without --url), use that
if (yargs.argv._.length > 1) {
args.url = yargs.argv._.pop();
const additionalArgs: string[] = (yargs.argv as any)._ as string[];
if (additionalArgs.length > 1) {
args.url = additionalArgs.pop();
}

if (!(args.url.startsWith('https://')
Expand Down

0 comments on commit d56808e

Please sign in to comment.