-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prompt): New
if-no-arg
prompt option (#17)
Authored-By: iamturns <matt@iamturns.com> * Add new `if-no-arg` prompt option * Update README.md explaining new prompt option * Add tests for each prompt option
- Loading branch information
1 parent
6a504b0
commit c91a74e
Showing
4 changed files
with
142 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Checks if the argument received is provided in the argument collection | ||
* @param {Object} arg - The arg to check (e.g. `likesPizza`) | ||
* @param {Object} processArgs - The collection of process arguments (e.g. `["--interactive", "--likesPizza=true"]`) | ||
* @return {boolean} - Returns true if the argument is present in the collection of process arguments, false otherwise. | ||
*/ | ||
module.exports = (arg, processArgs) => { | ||
return processArgs.some((argProvided) => argProvided === `--${arg}` || argProvided.startsWith(`--${arg}=`)); | ||
}; |
This file contains 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
This file contains 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