-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add replaces to all template and parse files from stdin (#596)
* Prefer repeated `--file` CLI params over splitting * Support adding files from standard input Using a null char as separator, which allows files with e.g. commas or end-of-line characters in their names. * Mark deprecation correctly * Simplify * chore: refactor files overrides from run arguments * chore: add integrity test on files override * chore: add a commend and remove odd spaces * chore: fix the error messages --------- Co-authored-by: Valentin Kiselev <[email protected]>
- Loading branch information
Showing
7 changed files
with
121 additions
and
21 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
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
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,42 @@ | ||
exec git init | ||
exec lefthook install | ||
exec git add -A | ||
|
||
exec lefthook run echo | ||
stdout 'a-file\.js' | ||
|
||
exec lefthook run echo --all-files | ||
stdout 'a-file\.js b_file\.go c,file\.rb' | ||
|
||
exec lefthook run echo --file a-file.js --file ghost.file | ||
stdout 'a-file\.js ghost\.file' | ||
|
||
stdin b_file.go | ||
exec lefthook run echo --files-from-stdin | ||
stdout 'b_file\.go c,file\.rb' | ||
|
||
stdin b_file.go | ||
exec lefthook run echo --files-from-stdin --file ghost.file | ||
stdout 'ghost\.file b_file\.go c,file\.rb' | ||
|
||
-- lefthook.yml -- | ||
skip_output: | ||
- meta | ||
- execution_info | ||
- summary | ||
|
||
echo: | ||
commands: | ||
echo: | ||
files: echo a-file.js | ||
run: echo "{files}" | ||
|
||
-- a-file.js -- | ||
a-file.js | ||
|
||
-- b_file.go -- | ||
b_file.go | ||
c,file.rb | ||
|
||
-- c,file.rb -- | ||
c,file.rb |