File: pre-push

package info (click to toggle)
lazygit 0.53.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,016 kB
  • sloc: sh: 136; makefile: 76
file content (27 lines) | stat: -rwxr-xr-x 651 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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': "
# this will print the password to the log view but real git won't do that.
# We could use read -s but that's not POSIX compliant.
read password

if [ "$username" = "username" -a "$password" = "password" ]; then
  echo "success"
  exit 0
fi

>&2 echo "incorrect username/password"
exit 1