Skip to content

Instantly share code, notes, and snippets.

@brandonkal
Created September 28, 2024 15:59
Show Gist options
  • Save brandonkal/ae83a5d13b24f66dc8cd3b3419532c83 to your computer and use it in GitHub Desktop.
Save brandonkal/ae83a5d13b24f66dc8cd3b3419532c83 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
dir="/tmp/zellij/bootstrap"
case $(uname -m) in
"x86_64"|"aarch64")
arch=$(uname -m)
;;
"arm64")
arch="aarch64"
;;
*)
echo "Unsupported cpu arch: $(uname -m)"
exit 2
;;
esac
case $(uname -s) in
"Linux")
sys="unknown-linux-musl"
dir="/usr/local/bin"
;;
"Darwin")
sys="apple-darwin"
;;
*)
echo "Unsupported system: $(uname -s)"
exit 2
;;
esac
mkdir -p "$dir"
url="https://github.com/zellij-org/zellij/releases/latest/download/zellij-$arch-$sys.tar.gz"
curl --location "$url" | sudo tar -C "$dir" -xz
if [[ $? -ne 0 ]]
then
echo
echo "Extracting binary failed, cannot install zellij :("
echo "One probable cause is that a new release just happened and the binary is currently building."
echo "Maybe try again later? :)"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment