Skip to content

Instantly share code, notes, and snippets.

@y4my4my4m
Created February 14, 2023 03:31
Show Gist options
  • Save y4my4my4m/9bf14f603da01cdea6a6ee2fdd27069b to your computer and use it in GitHub Desktop.
Save y4my4my4m/9bf14f603da01cdea6a6ee2fdd27069b to your computer and use it in GitHub Desktop.
A quick script to install discord for Arch. Sometimes discord need you to install the udpate as a .tar.gz. This script allows you to auto-install it. Just call this script from where you've downloaded the discord-0.0.25.tar.gz file and call it like "sudo discord-install.sh 25"
#!/bin/sh
set -e
if [ -z "$1" ] || ! [ "$1" -eq "$1" ] 2>/dev/null; then
echo "Invalid or missing argument. Please provide a valid number."
exit 1
fi
if sudo rm -rf /opt/Discord; then
echo "Removed old Discord installation."
else
echo "Failed to remove old Discord installation. Aborting."
exit 1
fi
echo "Extracting new Discord installation (version $1)..."
tar xvfz "$(pwd)/discord-0.0.$1.tar.gz"
echo "Moving new Discord installation to /opt..."
sudo mv "$(pwd)/Discord" /opt
@matheusfrancisco
Copy link

matheusfrancisco commented Aug 23, 2024

Discord can be launched directly from the search bar without needing to run it in the terminal. Equal to any other program

@y4my4my4m
Copy link
Author

@matheusfrancisco good to know, cheers!

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