Fri, 05 May 2023 13:12:54 -0500
factor out bina install
.lib/sh/stubexec.sh | file | annotate | diff | comparison | revisions | |
.lib/stubs/fzf | file | annotate | diff | comparison | revisions | |
.lib/stubs/gum | file | annotate | diff | comparison | revisions | |
.lib/stubs/just | file | annotate | diff | comparison | revisions |
--- a/.lib/sh/stubexec.sh +++ b/.lib/sh/stubexec.sh @@ -43,4 +43,12 @@ stubexec() { stubexec "$@" } +bina_install() { + local github_repo="$1" + mkdir -p ~/.local/bin + cd ~/.local/bin + curl -fsSL "https://bina.egoist.dev/${github_repo}?dir=." | sh + cd - +} + stubexec "$@"
--- a/.lib/stubs/fzf +++ b/.lib/stubs/fzf @@ -2,10 +2,7 @@ set -eu install_it() { - mkdir -p ~/.local/bin - cd ~/.local/bin - curl -fsSL 'https://bina.egoist.dev/junegunn/fzf?dir=.' | sh - cd - + bina_install "junegunn/fzf" } . ~/.lib/sh/stubexec.sh
--- a/.lib/stubs/gum +++ b/.lib/stubs/gum @@ -4,10 +4,7 @@ set -eu age_limit=7 install_it() { - mkdir -p ~/.local/bin - cd ~/.local/bin - curl -fsSL 'https://bina.egoist.dev/charmbracelet/gum?dir=.' | sh - cd - + bina_install "charmbracelet/gum" # go install github.com/charmbracelet/gum@latest # asdf reshim || : }