0

I have a script for a git post-receive hook

read oldrev newrev refname
set -e

echo DELETE
rm -rf *
echo DELETED
...

When I run the script, the ouput looks like this

remote: DELETE

But then the script stops. But when I remove the "set -e" or remove the "read" it works.

read oldrev newrev refname

echo DELETE
rm -rf *
echo DELETED
...

results to

remote: DELETE
remote: DELETED

or

set -e

echo DELETE
rm -rf *
echo DELETED

results to

remote: DELETE
remote: DELETED

I don't understand why it doesn't work.

Edit: Add output of the second and third code example

William M.
  • 369
  • 1
  • 5
  • 10

0 Answers0