Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compatibility with commander v7 #177

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

gustavkj
Copy link
Collaborator

Fixes the code to work with commander v7 (related to #162).

A breaking change is that the command and options have been split up. Example from their changelog:

program
  .command('compress <filename>')
  .option('-t, --trace')
  // Old code before Commander 7
  .action((filename, cmd)) => {
    if (cmd.trace) console.log(`Command name is ${cmd.name()}`);
  });
  // New code
  .action((filename, options, command)) => {
    if (options.trace) console.log(`Command name is ${command.name()}`);
  });

@gustavkj gustavkj force-pushed the fix-compatibility-with-commander-v7 branch from 0303eb2 to 12b5c9e Compare January 22, 2021 16:03
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 504074647

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 502871415: 0.0%
Covered Lines: 211
Relevant Lines: 211

💛 - Coveralls

@codecov
Copy link

codecov bot commented Jan 22, 2021

Codecov Report

Merging #177 (12b5c9e) into master (fd6803c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #177   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          216       216           
  Branches        36        36           
=========================================
  Hits           216       216           
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/commands/generate.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd6803c...12b5c9e. Read the comment docs.

@gagoar
Copy link
Owner

gagoar commented Jan 22, 2021

we need something that uses the cli so we don't end up here again. much like this so this happens when some API changes. I'm gonna create an issue because is gonna be a bit harder with what we have.

@gagoar gagoar merged commit b79e346 into gagoar:master Jan 22, 2021
@gustavkj gustavkj deleted the fix-compatibility-with-commander-v7 branch January 22, 2021 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants