Skip to content

Commit

Permalink
Merge pull request desktop#6260 from desktop/upstream-fix-for-install…
Browse files Browse the repository at this point in the history
…-scripts

spaces in filenames are problematic for profile scripts
  • Loading branch information
Brendan Forster authored Dec 19, 2018
2 parents 2779741 + dc775fa commit cf99e95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions script/linux-after-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

set -e

PROFILE_D_FILE="/etc/profile.d/${productFilename}.sh"
PROFILE_D_FILE="/etc/profile.d/github-desktop.sh"
INSTALL_DIR="/opt/${productFilename}"
SCRIPT="#!/bin/sh
export PATH=$INSTALL_DIR:\$PATH"
SCRIPT=$"#!/bin/sh
export PATH=\"$INSTALL_DIR:\$PATH\""

case "$1" in
configure)
echo "$SCRIPT" > ${PROFILE_D_FILE};
. ${PROFILE_D_FILE};
echo "$SCRIPT" > "${PROFILE_D_FILE}";
. "${PROFILE_D_FILE}";
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
10 changes: 5 additions & 5 deletions script/linux-after-remove.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
set -e

PROFILE_D_FILE="/etc/profile.d/${productFilename}.sh"
PROFILE_D_FILE="/etc/profile.d/github-desktop.sh"

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};
echo "#!/bin/sh" > "${PROFILE_D_FILE}";
. "${PROFILE_D_FILE}";
rm "${PROFILE_D_FILE}";
;;

*)
Expand All @@ -16,4 +16,4 @@ case "$1" in
;;
esac

exit 0
exit 0

0 comments on commit cf99e95

Please sign in to comment.