Mercurial > repos > fubar > egapx_runner
annotate oldgit/hooks/pre-receive.sample @ 2:a3b158471bd3 draft
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
author | fubar |
---|---|
date | Sun, 04 Aug 2024 00:06:43 +0000 |
parents | |
children |
rev | line source |
---|---|
2
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
1 #!/bin/sh |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
2 # |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
3 # An example hook script to make use of push options. |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
4 # The example simply echoes all push options that start with 'echoback=' |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
5 # and rejects all pushes when the "reject" push option is used. |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
6 # |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
7 # To enable this hook, rename this file to "pre-receive". |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
8 |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
9 if test -n "$GIT_PUSH_OPTION_COUNT" |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
10 then |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
11 i=0 |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
12 while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
13 do |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
14 eval "value=\$GIT_PUSH_OPTION_$i" |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
15 case "$value" in |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
16 echoback=*) |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
17 echo "echo from the pre-receive-hook: ${value#*=}" >&2 |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
18 ;; |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
19 reject) |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
20 exit 1 |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
21 esac |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
22 i=$((i + 1)) |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
23 done |
a3b158471bd3
planemo upload for repository https://github.com/ncbi/egapx commit 98875ef7eda9323fc9991970103954e9097d9e73
fubar
parents:
diff
changeset
|
24 fi |