-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable reading file/directory list from stdin
This adds the `--stdin` flag, which makes jscodeshift read the list of files and directories to process from standard input instead of command line arguments. Given that jscodeshift is getting input from multiple sources (file list, transformer code, source code), there are obviously multiple options for what should be accepted on the standard input. My more longer term idea is to be able to accept any of these on stdin. The first step is the file/directory list. I decided to add the `--stdin` flag instead of reading from stdin by default, to require the user to be explicit about their intention. In the future I could imagine the other inputs being provided on stdin by using `-` as argument value. This is in-line with other commands, like `cat`. E.g. reading the transform from stdin could be done via `--transform -`. Similarly getting the source code from stdin could be done by passing `-` as a single positional argument.
- Loading branch information
Showing
3 changed files
with
49 additions
and
9 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
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