bin/homedir-setup

Sun, 09 Jan 2022 14:57:39 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 09 Jan 2022 14:57:39 -0500
changeset 965
f1e5d30543ba
parent 964
72a7a0ffbce8
child 966
e1132c1cce12
permissions
-rwxr-xr-x

forget the minimal setup mode

964
72a7a0ffbce8 retire plenv for asdf
Meredith Howard <mhoward@roomag.org>
parents: 850
diff changeset
1 #!/bin/bash
72a7a0ffbce8 retire plenv for asdf
Meredith Howard <mhoward@roomag.org>
parents: 850
diff changeset
2 set -euo pipefail
245
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
285
fefaa23c064c Add check for .zshrc
Meredith Howard <mhoward@roomag.org>
parents: 275
diff changeset
4 if [ ! -f .zshrc ]; then
fefaa23c064c Add check for .zshrc
Meredith Howard <mhoward@roomag.org>
parents: 275
diff changeset
5 echo "Refusing to run without a .zshrc nearby" >&2
fefaa23c064c Add check for .zshrc
Meredith Howard <mhoward@roomag.org>
parents: 275
diff changeset
6 exit 1
fefaa23c064c Add check for .zshrc
Meredith Howard <mhoward@roomag.org>
parents: 275
diff changeset
7 fi
fefaa23c064c Add check for .zshrc
Meredith Howard <mhoward@roomag.org>
parents: 275
diff changeset
8
245
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 if ! git --version >/dev/null; then
285
fefaa23c064c Add check for .zshrc
Meredith Howard <mhoward@roomag.org>
parents: 275
diff changeset
10 echo "Please install git!" >&2
245
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 exit 1
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 fi
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13
849
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
14 clone_or_pull() {
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
15 if ! [ -d $2 ]; then
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
16 git clone --depth 1 "$1" $2
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
17 else
850
Meredith Howard <mhoward@roomag.org>
parents: 849
diff changeset
18 echo "$2:"
Meredith Howard <mhoward@roomag.org>
parents: 849
diff changeset
19 git -C "$2" pull --no-tags
849
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
20 fi
245
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
21 }
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
22
849
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
23 clone_or_pull 'https://github.com/tarjoilija/zgen.git' .zgen
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
24
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
25 zsh -i -c 'zgen update' || :
245
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
26
965
f1e5d30543ba forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents: 964
diff changeset
27 clone_or_pull 'https://github.com/asdf-vm/asdf' .asdf
f1e5d30543ba forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents: 964
diff changeset
28 source .asdf/asdf.sh
245
9fa186a70bbd add .homedir-setup.sh
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
29
965
f1e5d30543ba forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents: 964
diff changeset
30 asdf plugin add perl || :
f1e5d30543ba forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents: 964
diff changeset
31 asdf plugin update --all
756
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents: 534
diff changeset
32
965
f1e5d30543ba forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents: 964
diff changeset
33 bin/setup-man || :
381
b09db2db7f84 use ruby and nodejs plugins for asdf
Meredith Howard <mhoward@roomag.org>
parents: 328
diff changeset
34
459
efa21f0b1dca Remove rbenv & ndenv transition stuff
Meredith Howard <mhoward@roomag.org>
parents: 383
diff changeset
35 # Get rid of older stuff
964
72a7a0ffbce8 retire plenv for asdf
Meredith Howard <mhoward@roomag.org>
parents: 850
diff changeset
36 for OLD in .plenv .rbenv .ndenv; do
849
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
37 if [ -e $OLD ]; then
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
38 echo "Pruning $OLD" >&2
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
39 rm -rf $OLD
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
40 fi
9a6cb845e239 Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents: 760
diff changeset
41 done

mercurial