changeset 823:2e86aa5360eb

feat: install recent fd and ripgrep in home
author zegervdv <zegervdv@me.com>
date Thu, 21 Dec 2023 10:43:19 +0100
parents 0c2dcf35d759
children 1b779efc2b42
files .chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl .chezmoiscripts/run_onchange_after_22-install-devtools.sh.tmpl
diffstat 2 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl	Mon Dec 25 21:24:11 2023 +0000
+++ b/.chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl	Thu Dec 21 10:43:19 2023 +0100
@@ -39,7 +39,7 @@
 
 {{ range $ppa }}
 sudo add-apt-repository -y --no-update --ppa {{ . }}
-{{ end}}
+{{ end }}
 
 sudo mkdir -p /etc/apt/preferences.d/
 sudo cp -v {{ .chezmoi.sourceDir }}/system/ubuntu/mozilla-firefox /etc/apt/preferences.d/mozilla-firefox
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_22-install-devtools.sh.tmpl	Thu Dec 21 10:43:19 2023 +0100
@@ -0,0 +1,26 @@
+{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu" )) -}}
+{{ $packages := dict
+				 "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")
+				 "rg" (dict "version" "14.0.3" "url" "https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-x86_64-unknown-linux-musl.tar.gz") -}}
+#!/usr/bin/env bash
+
+set -xe
+
+DOWNLOAD_DIR=${TMPDIR:-/tmp}/devtools
+INSTALL_DIR=$HOME/bin
+
+mkdir -p $DOWNLOAD_DIR
+pushd $DOWNLOAD_DIR
+
+{{ range keys $packages }}
+{{ $meta :=  get $packages . -}}
+VERSION={{ get $meta "version" }}
+echo "Downloading {{ . }} v{{ get $meta "version" }} ..."
+curl -fsSL {{ get $meta "url" }} | tar --strip-components=1 -xz
+sudo install -m 755 $DOWNLOAD_DIR/{{ . }} $INSTALL_DIR/{{ . }}
+{{ end }}
+
+popd
+rm -rf $DOWNLOAD_DIR
+
+{{ end }}