-
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.
- Loading branch information
1 parent
9a36234
commit ee3cd87
Showing
8 changed files
with
66 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[windows] skip | ||
|
||
exec git init | ||
exec lefthook add pre-commit | ||
! stderr . | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[windows] skip | ||
|
||
exec git init | ||
exec lefthook dump | ||
cmp stdout lefthook-dumped.yml | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[windows] skip | ||
|
||
exec git init | ||
exec lefthook install | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[windows] skip | ||
|
||
exec git init | ||
exec lefthook install | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[windows] skip | ||
|
||
chmod 0700 hook.sh | ||
chmod 0700 commit-with-interrupt.sh | ||
exec git init | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,9 @@ exec lefthook install | |
exec git config user.email "[email protected]" | ||
exec git config user.name "Your Name" | ||
|
||
exec lefthook run echo_files | ||
[unix] exec lefthook run echo_files | ||
[windows] exec lefthook run echo_files_windows | ||
|
||
stdout '1.txt 10.txt' | ||
|
||
-- lefthook.yml -- | ||
|
@@ -22,6 +24,12 @@ echo_files: | |
files: ls | grep 1 | ||
run: echo {files} | ||
|
||
echo_files_windows: | ||
commands: | ||
echo: | ||
files: dir | findstr "1" | ||
run: echo {files} | ||
|
||
-- 1.txt -- | ||
1.txt | ||
|
||
|
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 @@ | ||
[!windows] skip | ||
|
||
exec git init | ||
exec git add -A | ||
exec lefthook run skip | ||
! stdout 'Ha-ha!' | ||
exec lefthook run no-skip | ||
stdout 'Ha-ha!' | ||
|
||
exec lefthook run skip-var | ||
! stdout 'Ha-ha!' | ||
|
||
env VAR=1 | ||
exec lefthook run skip-var | ||
stdout 'Ha-ha!' | ||
|
||
-- lefthook.yml -- | ||
skip_output: | ||
- skips | ||
- meta | ||
- summary | ||
- execution_info | ||
skip: | ||
skip: | ||
- run: powershell -Command "if (1 -eq 1) { exit 0 } else { exit 1 }" | ||
commands: | ||
echo: | ||
run: echo 'Ha-ha!' | ||
|
||
no-skip: | ||
skip: | ||
- run: powershell -Command "if (1 -eq 0) { exit 0 } else { exit 1 }" | ||
commands: | ||
echo: | ||
run: echo 'Ha-ha!' | ||
|
||
skip-var: | ||
skip: | ||
- run: powershell -Command "if ([string]::IsNullOrEmpty($env:VAR)) { exit 0 } else { exit 1 }" | ||
commands: | ||
echo: | ||
run: echo 'Ha-ha!' |