Mercurial > dotfiles
annotate .chezmoiscripts/run_onchange_after_22-install-devtools.sh.tmpl @ 825:6c169d906c7d
feat: enable highlighting for chezmoi .tmpl files
author | zegervdv <zegervdv@me.com> |
---|---|
date | Thu, 21 Dec 2023 11:47:51 +0100 |
parents | 2e86aa5360eb |
children | e4d67607d020 |
rev | line source |
---|---|
823
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
1 {{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu" )) -}} |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
2 {{ $packages := dict |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
3 "fd" (dict "version" "9.0.0" "url" "https://github.com/sharkdp/fd/releases/download/v${VERSION}/fd-v${VERSION}-i686-unknown-linux-musl.tar.gz") |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
4 "rg" (dict "version" "14.0.3" "url" "https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-x86_64-unknown-linux-musl.tar.gz") -}} |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
5 #!/usr/bin/env bash |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
6 |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
7 set -xe |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
8 |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
9 DOWNLOAD_DIR=${TMPDIR:-/tmp}/devtools |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
10 INSTALL_DIR=$HOME/bin |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
11 |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
12 mkdir -p $DOWNLOAD_DIR |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
13 pushd $DOWNLOAD_DIR |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
14 |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
15 {{ range keys $packages }} |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
16 {{ $meta := get $packages . -}} |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
17 VERSION={{ get $meta "version" }} |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
18 echo "Downloading {{ . }} v{{ get $meta "version" }} ..." |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
19 curl -fsSL {{ get $meta "url" }} | tar --strip-components=1 -xz |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
20 sudo install -m 755 $DOWNLOAD_DIR/{{ . }} $INSTALL_DIR/{{ . }} |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
21 {{ end }} |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
22 |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
23 popd |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
24 rm -rf $DOWNLOAD_DIR |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
25 |
2e86aa5360eb
feat: install recent fd and ripgrep in home
zegervdv <zegervdv@me.com>
parents:
diff
changeset
|
26 {{ end }} |