Last active
November 26, 2021 22:23
-
-
Save UltiRequiem/e63fd0b3135d61df5cb4f2dc3adb9634 to your computer and use it in GitHub Desktop.
simplex-chat installer
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
# Constants | |
VERSION="v0.4.2" | |
SIMPLEX_CHAT="simplex-chat" | |
###################### | |
PLATAFORM="" | |
if [ "$(uname)" == "Darwin" ]; then | |
PLATAFORM="macos-x86-64" | |
elif [ "$(uname)" == "Linux" ]; then | |
PLATAFORM="ubuntu-20_04-x86-64" | |
else | |
echo "Your platform is not suported, try with macos/linux." | |
exit 1 | |
fi | |
PLATAFORM_BIN="$SIMPLEX_CHAT-$PLATAFORM" | |
###################### | |
###################### | |
# Detect the shell and the file where to export the path | |
FILE_TO_EXPORT="" | |
if [ -n "$($SHELL -c 'echo $ZSH_VERSION')" ]; then | |
FILE_TO_EXPORT=".zshrc" | |
elif [ -n "$($SHELL -c 'echo $BASH_VERSION')" ]; then | |
FILE_TO_EXPORT=".bashrc" | |
else | |
echo "Your shell is not suported, try with bash/zsh." | |
exit 1 | |
fi | |
###################### | |
# Check if the directory exists | |
SIMPLEX_CHAT_DIR="$HOME/.config/$SIMPLEX_CHAT" | |
[ ! -d $SIMPLEX_CHAT_DIR ] && mkdir -p $SIMPLEX_CHAT_DIR | |
# Build the url | |
URL="https://github.com/$SIMPLEX_CHAT/$SIMPLEX_CHAT/releases/download/$VERSION/$PLATAFORM_BIN" | |
# Download the binary and make it executable | |
wget -O $SIMPLEX_CHAT_DIR/simplex-chat $URL && chmod +x $SIMPLEX_CHAT_DIR/simplex-chat | |
# Export the path to the binary | |
echo "export PATH=\$PATH:$SIMPLEX_CHAT_DIR" >>$HOME/$FILE_TO_EXPORT | |
# Exit message with instructions | |
echo "simplex-chat is installed, source your $FILE_TO_EXPORT or open a new shell" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This two should be working and doing the same:
wget -qO- https://gist.githubusercontent.com/UltiRequiem/e63fd0b3135d61df5cb4f2dc3adb9634/raw/402a7cd39e0209756bd52ef3bfd32271bbaa08d4/install.sh | bash
Or
curl https://gist.githubusercontent.com/UltiRequiem/e63fd0b3135d61df5cb4f2dc3adb9634/raw/402a7cd39e0209756bd52ef3bfd32271bbaa08d4/install.sh | bash