Skip to content

Instantly share code, notes, and snippets.

@chshersh
Last active January 3, 2024 12:50
Show Gist options
  • Save chshersh/61240e8e6eeeddd139781e6b9c54a6fe to your computer and use it in GitHub Desktop.
Save chshersh/61240e8e6eeeddd139781e6b9c54a6fe to your computer and use it in GitHub Desktop.
Installing from GitHub releases
#!/bin/bash
set -Eeuxo pipefail
# This script installs a developer tool on your machine
# by downloading an executable (ideally, statically linked)
# from GitHub releases
## Example: ripgrep
dir=$(mktemp --tmpdir --directory ripgrep-XXXX)
curl -L https://github.com/BurntSushi/ripgrep/releases/download/14.0.3/ripgrep-14.0.3-aarch64-apple-darwin.tar.gz > "$dir/ripgrep.tar.gz"
tar -xzf "$dir/ripgrep.tar.gz" --directory=$dir
cp "$dir/ripgrep-14.0.3-aarch64-apple-darwin/rg" ~/.local/bin/rg
chmod +x ~/.local/bin/rg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment