diff .chezmoiscripts/run_once_after_99-build-zsh-histdb-skim.sh.tmpl @ 686:e486254ef420

fix: improve asdf installer script
author zegervdv <zegervdv@me.com>
date Sun, 02 Oct 2022 18:22:00 +0200
parents 189d0c688639
children 6aabd0b8d766
line wrap: on
line diff
--- a/.chezmoiscripts/run_once_after_99-build-zsh-histdb-skim.sh.tmpl	Sun Oct 02 11:27:18 2022 +0200
+++ b/.chezmoiscripts/run_once_after_99-build-zsh-histdb-skim.sh.tmpl	Sun Oct 02 18:22:00 2022 +0200
@@ -1,11 +1,20 @@
 {{ if (or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin")) -}}
 #!/usr/bin/env zsh
 
+source $(brew --prefix asdf)/libexec/asdf.sh
 asdf shell rust 1.64.0
 brew unlink sqlite
 
-git clone https://github.com/zegervdv/zsh-histdb-skim $HOME/.local/share/zsh-histdb-skim
-cd $HOME/.local/share/zsh-histdb-skim
+HISTDB_SKIM_DIR="$HOME/.local/share/zsh-histdb-skim"
+if [[ -d "$HISTDB_SKIM_DIR" ]]
+then
+  cd "$HISTDB_SKIM_DIR"
+  git pull
+else
+  git clone https://github.com/zegervdv/zsh-histdb-skim "$HISTDB_SKIM_DIR"
+fi
+cd "$HISTDB_SKIM_DIR"
+
 cargo build --release
 cp target/release/zsh-histdb-skim zsh-histdb-skim