From 8ae2eeb3ff524ef695573fbe61b75e3f0e3c4047 Mon Sep 17 00:00:00 2001 From: Botspot Date: Sat, 14 Aug 2021 22:58:52 -0500 Subject: [PATCH] Discord: use pkg-install --- apps/Discord/install-32 | 10 +++------- apps/Discord/install-64 | 10 +++------- apps/Discord/uninstall | 10 ++++------ 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/apps/Discord/install-32 b/apps/Discord/install-32 index 082db0e..2ebbf09 100755 --- a/apps/Discord/install-32 +++ b/apps/Discord/install-32 @@ -9,15 +9,11 @@ function error { version='1.6.1' -#remove electron-discord-webapp if it still exists -if command -v webcord >/dev/null ;then - sudo apt purge webcord || error "failed to first uninstall electron-discord-webapp!" -fi - echo "Downloading Webcord..." - rm -f ~/webcord_${version}_armhf.deb wget https://github.com/SpacingBat3/WebCord/releases/download/v${version}/webcord_${version}_armhf.deb -sudo apt -fy install ~/webcord_${version}_armhf.deb || error "Failed to install webcord deb!" + +echo "Installing Webcord..." +"${DIRECTORY}/pkg-install" "$HOME/webcord_${version}_armhf.deb" "$(dirname "$0")" || error "Failed to install webcord deb!" rm -f ~/webcord_${version}_armhf.deb diff --git a/apps/Discord/install-64 b/apps/Discord/install-64 index 0bf54d6..0017b42 100755 --- a/apps/Discord/install-64 +++ b/apps/Discord/install-64 @@ -9,15 +9,11 @@ function error { version='1.6.1' -#remove electron-discord-webapp if it still exists -if command -v webcord >/dev/null ;then - sudo apt purge webcord || error "failed to first uninstall electron-discord-webapp!" -fi - echo "Downloading Webcord..." - rm -f ~/webcord_${version}_arm64.deb wget https://github.com/SpacingBat3/WebCord/releases/download/v${version}/webcord_${version}_arm64.deb -sudo apt -fy install ~/webcord_${version}_arm64.deb || error "Failed to install webcord deb!" + +echo "Installing Webcord..." +"${DIRECTORY}/pkg-install" "$HOME/webcord_${version}_arm64.deb" "$(dirname "$0")" || error "Failed to install webcord deb!" rm -f ~/webcord_${version}_arm64.deb diff --git a/apps/Discord/uninstall b/apps/Discord/uninstall index 5637718..3bc4252 100755 --- a/apps/Discord/uninstall +++ b/apps/Discord/uninstall @@ -7,10 +7,8 @@ function error { exit 1 } -if command -v webcord >/dev/null ;then - killall webcord &>/dev/null && echo "Closing Discord before uninstalling..." - - "${DIRECTORY}/api" apt_lock_wait - sudo apt purge -y webcord || error "APT failed to purge webcord!" -fi +killall webcord &>/dev/null && echo "Closing Discord before uninstalling..." + +"${DIRECTORY}/purge-installed" "$(dirname "$0")" || error "APT failed to purge webcord!" + exit 0