You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Botspot-Pi-Apps/apps/Discord/install

37 lines
945 B
Bash

#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\\e[91m$1\\e[39m"
exit 1
}
git clone https://github.com/SpacingBat3/electron-discord-webapp || error "Failed to download repo!"
if [ ! -f /usr/bin/npm ];then
echo "npm is not installed. Installing npm now..."
"${DIRECTORY}/pkg-install" "npm" "$(dirname "$0")" || exit 1
echo "Updating npm to latest version..."
sudo npm install -g npm || error "failed to update npm to latest version!"
fi
cd electron-discord-webapp
npm install
#Create desktop shortcut
echo "[Desktop Entry]
StartupNotify=true
Terminal=false
Type=Application
Name=Discord
Path=$HOME/electron-discord-webapp
Exec=npm start
Icon=/home/pi/pi-apps/apps/Discord/icon-64.png
Categories=Network;Chat;VideoConference;WebApp;Internet
Comment=Your place to talk!
GenericName=Network Messenger" > ~/.local/share/applications/discord.desktop