#!/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