-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easier to use jq with shebangs (fix #1044)
Allow a continuation on a comment immediately after a shebang to make this traditional hack possible: #!/bin/sh # this next line is ignored by jq \ exec jq -f "$0" "$@" # jq code follows But continue only on the first line following a shebang, and only if it's a comment.
- Loading branch information
1 parent
856a4b2
commit 8f6f28c
Showing
3 changed files
with
22 additions
and
1 deletion.
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,4 @@ | ||
#!/bin/sh | ||
# this next line is ignored by jq, which otherwise does not continue comments \ | ||
exec jq -nef "$0" "$@" | ||
true |
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
8f6f28c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.