From 47ee225a0742eebbff7608b03b68d99cdf7521fd Mon Sep 17 00:00:00 2001 From: Jeff Gordon Date: Tue, 14 Apr 2020 05:02:06 -0500 Subject: [PATCH] Added test for symlinks Reduce errors produced in terminal from debian package installations by testing for existence of symlink prior to executing unlink --- script/linux-after-remove.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/linux-after-remove.sh b/script/linux-after-remove.sh index 64c0803dec3..d85b3eb28e8 100644 --- a/script/linux-after-remove.sh +++ b/script/linux-after-remove.sh @@ -2,6 +2,7 @@ set -e PROFILE_D_FILE="/etc/profile.d/github-desktop.sh" +BASE_FILE="/usr/bin/github" case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) @@ -9,9 +10,9 @@ case "$1" in . "${PROFILE_D_FILE}"; rm "${PROFILE_D_FILE}"; # remove symbolic links in /usr/bin directory - unlink /usr/bin/github-desktop || : - unlink /usr/bin/github-desktop-dev || : - unlink /usr/bin/github || : + test -f ${BASE_FILE} && unlink ${BASE_FILE} + test -f ${BASE_FILE}-desktop && unlink ${BASE_FILE}-desktop + test -f ${BASE_FILE}-desktop-dev && unlink ${BASE_FILE}-desktop-dev ;; *)