1 #!/bin/sh |
1 #!/bin/bash |
2 set -eu |
2 set -eu -o pipefail |
3 |
3 |
4 if [ -d ~/.hgext/hg-git ]; then |
4 if ! (command -v pip2 && pip2 -V) &>/dev/null; then |
5 hg -R ~/.hgext/hg-git fetch |
5 curl -fsSL --compressed https://bootstrap.pypa.io/get-pip.py | |
6 else |
6 python2 - --user |
7 hg clone https://bitbucket.org/durin42/hg-git ~/.hgext/hg-git |
|
8 |
|
9 [ -f ~/.hgext/hgrc ] || echo '[extensions]' > ~/.hgext/hgrc |
|
10 echo 'hggit = ~/.hgext/hg-git/hggit' >> ~/.hgext/hgrc |
|
11 fi |
7 fi |
12 |
8 |
|
9 pip2 install --user --upgrade hg-git |
|
10 |
|
11 if ! grep -qsw hggit ~/.hgext/hgrc; then |
|
12 printf '[extensions]\nhggit =\n' >> ~/.hgext/hgrc |
|
13 fi |