Closed Konfekt closed 1 year ago
For those distributions without a package, here's a simple update script of a folder ~/bin/git-absorb:
~/bin/git-absorb
#!/usr/bin/env sh # debug output and exit on error or use of undeclared variable or pipe error: set -o xtrace -o errtrace -o errexit -o nounset -o pipefail latest_tag="$(curl --location --head https://github.com/tummychow/git-absorb/releases/latest | grep -i location: | sed 's/^.*\/tag\/\([^\/]*\)\r$/\1/')" filename="git-absorb-${latest_tag}-x86_64-unknown-linux-musl.tar.gz" uri_to_download="https://github.com/tummychow/git-absorb/releases/download/${latest_tag}/${filename}" { cd "$(mktemp --directory "${TMPDIR:-/tmp}/git-absorb-update.XXXXXXXXXX")" curl --fail --show-error --remote-name --location "$uri_to_download" tar xf "$filename" cp -ru "git-absorb-${latest_tag}-x86_64-unknown-linux-musl/"* "$HOME/bin/git-absorb"/ tmpdir="$PWD" trap 'rm -rf "$tmpdir"' EXIT } if [ ! -x "$HOME/bin/git-absorb/git-absorb" ]; then echo '"git-absorb" was not successfully installed!' >&2 exit 2 fi
For those distributions without a package, here's a simple update script of a folder
~/bin/git-absorb
: