Conversation
Since this is the entry point to the module, we need to grab module.parent from here and not in utils.js, otherwise we would end up with the module object from index.js and grab args' version instead of the CLI app's version.
Closed
Owner
|
Thanks! ❤️ |
Owner
ntwcklng
pushed a commit
that referenced
this pull request
Apr 3, 2018
* fix(defaults): Process help and version defaults better Also removes unnecessary "pkginfo" dependency * fix(command): Pass any options that appear before a command * task(version): Remove unnecessary parent parameter introduced in #96 feat(config): Add "exit" booleans for help and version fix(help): Clone objects in array so original data is not altered Fixes #95 * test(options): Add assertions to ensure "help" and "version" options work properly * docs(options): Add ".showVersion()" method and "exit" configuration * fix(generateDetails): Use Object.assign instead of spread for older node versions * fix(version): Use process.mainModule instead of module.parent
leo
pushed a commit
that referenced
this pull request
May 1, 2022
leo
pushed a commit
that referenced
this pull request
May 1, 2022
* fix(defaults): Process help and version defaults better Also removes unnecessary "pkginfo" dependency * fix(command): Pass any options that appear before a command * task(version): Remove unnecessary parent parameter introduced in #96 feat(config): Add "exit" booleans for help and version fix(help): Clone objects in array so original data is not altered Fixes #95 * test(options): Add assertions to ensure "help" and "version" options work properly * docs(options): Add ".showVersion()" method and "exit" configuration * fix(generateDetails): Use Object.assign instead of spread for older node versions * fix(version): Use process.mainModule instead of module.parent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since this is the entry point to the module, we need
to grab
module.parentfrom here and not in utils.js,otherwise we would end up with the
moduleobject fromindex.jsand grab args' version instead of the CLI app'sversion.