2018-12-16 08:55:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# test pre-push hook for testing the lazygit credentials view
|
|
|
|
#
|
|
|
|
# to enable, use:
|
|
|
|
# chmod +x .git/hooks/pre-push
|
|
|
|
#
|
|
|
|
# this will hang if you're using git from the command line, so only enable this
|
|
|
|
# when you are testing the credentials view in lazygit
|
|
|
|
|
|
|
|
exec < /dev/tty
|
|
|
|
|
|
|
|
echo -n "Username for 'github': "
|
|
|
|
read username
|
|
|
|
|
|
|
|
echo -n "Password for 'github': "
|
|
|
|
read password
|
|
|
|
|
2018-12-18 12:27:39 +02:00
|
|
|
if [ "$username" = "username" -a "$password" = "password" ]; then
|
|
|
|
echo "success"
|
|
|
|
exit 0
|
|
|
|
fi
|
2018-12-16 08:55:37 +02:00
|
|
|
|
2018-12-18 12:27:39 +02:00
|
|
|
>&2 echo "incorrect username/password"
|
|
|
|
exit 1
|