Last active
April 15, 2024 15:48
-
-
Save ferdinandkeller/26d23e6fec8ec2e80663fa2a327492ee to your computer and use it in GitHub Desktop.
Script to install Zellij on Debian/Ubuntu without snap packages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# derived from official installation script: https://zellij.dev/launch | |
dir="/usr/local/bin" | |
if [[ -x "$dir/zellij" ]] | |
then | |
"$dir/zellij" "$@" | |
exit | |
fi | |
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" | |
;; | |
"Darwin") | |
sys="apple-darwin" | |
;; | |
*) | |
echo "Unsupported system: $(uname -s)" | |
exit 2 | |
;; | |
esac | |
url="https://github.com/zellij-org/zellij/releases/latest/download/zellij-$arch-$sys.tar.gz" | |
sudo bash -c "curl --location $url | tar -C $dir -xz" | |
if [[ $? -ne 0 ]] | |
then | |
echo | |
echo "Extracting binary failed, cannot launch 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 | |
"$dir/zellij" "$@" | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script is derived from the official try script, but with the added install functionality, so that you can reuse it multiple times.