Skip to content

Instantly share code, notes, and snippets.

@UltiRequiem
Last active November 26, 2021 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UltiRequiem/e63fd0b3135d61df5cb4f2dc3adb9634 to your computer and use it in GitHub Desktop.
Save UltiRequiem/e63fd0b3135d61df5cb4f2dc3adb9634 to your computer and use it in GitHub Desktop.
simplex-chat installer
# 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"
@UltiRequiem
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment