Skip to content

Commit

Permalink
Added test for symlinks
Browse files Browse the repository at this point in the history
Reduce errors produced in terminal from debian package installations by testing for existence of symlink prior to executing unlink
  • Loading branch information
jfgordon2 authored and shiftkey committed May 18, 2020
1 parent 7adff4a commit 5306133
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions script/linux-after-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
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)
echo "#!/bin/sh" > "${PROFILE_D_FILE}";
. "${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
;;

*)
Expand Down

0 comments on commit 5306133

Please sign in to comment.