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