Skip to content

Commit

Permalink
Pass correct arguments for create routines to constructors (#25)
Browse files Browse the repository at this point in the history
* Pass correct arguments for create routines to constructors
* Basic tests for global createX using Jest
* Add commander for old node in GitHub Actions
  • Loading branch information
shadowspawn authored Jan 23, 2023
1 parent 29f5beb commit 9e9426f
Show file tree
Hide file tree
Showing 7 changed files with 5,694 additions and 365 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ jobs:
# Use separate run commands so command status handled correctly on Windows
- name: npm install
run: npm ci
- name: npm install commander for old npm
run: npm install commander@10.0
- name: npm test
run: npm test
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ exports.Option = commander.Option;
// In Commander, the create routines end up being aliases for the matching
// methods on the global program due to the (deprecated) legacy default export.
// Here we roll our own, the way Commander might in future.
exports.createArgument = (name) => new commander.Argument(name);
exports.createCommand = (flags, description) => new commander.Command(flags, description);
exports.createOption = (name) => new commander.Option(name, description);
exports.createCommand = (name) => new commander.Command(name);
exports.createOption = (flags, description) => new commander.Option(flags, description);
exports.createArgument = (name, description) => new commander.Argument(name, description);
Loading

0 comments on commit 9e9426f

Please sign in to comment.