From 51c9efec1161d8eb02f23e107f96e96a5bf61778 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Wed, 21 Nov 2018 14:58:21 -0400 Subject: [PATCH 1/3] rename profile script to avoid spaces --- script/linux-after-install.sh | 2 +- script/linux-after-remove.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/linux-after-install.sh b/script/linux-after-install.sh index bd40c2b3785..896b65de7f3 100644 --- a/script/linux-after-install.sh +++ b/script/linux-after-install.sh @@ -2,7 +2,7 @@ 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" diff --git a/script/linux-after-remove.sh b/script/linux-after-remove.sh index 7260fd93767..d5ded98315e 100644 --- a/script/linux-after-remove.sh +++ b/script/linux-after-remove.sh @@ -1,7 +1,7 @@ #!/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) From 0fa2a184b4d8435c0160c828713184f49463ff96 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Wed, 21 Nov 2018 14:58:58 -0400 Subject: [PATCH 2/3] wrap path in quote marks as sanity check --- script/linux-after-install.sh | 4 ++-- script/linux-after-remove.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script/linux-after-install.sh b/script/linux-after-install.sh index 896b65de7f3..f1d78cb69e2 100644 --- a/script/linux-after-install.sh +++ b/script/linux-after-install.sh @@ -9,8 +9,8 @@ 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) diff --git a/script/linux-after-remove.sh b/script/linux-after-remove.sh index d5ded98315e..9a73886e2a5 100644 --- a/script/linux-after-remove.sh +++ b/script/linux-after-remove.sh @@ -5,9 +5,9 @@ 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}"; ;; *) @@ -16,4 +16,4 @@ case "$1" in ;; esac -exit 0 \ No newline at end of file +exit 0 From dc775fa11f72c88e8c3fdddb8723ce8b67d54aea Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Wed, 21 Nov 2018 14:59:16 -0400 Subject: [PATCH 3/3] corrected formatting of emitted profile script --- script/linux-after-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/linux-after-install.sh b/script/linux-after-install.sh index f1d78cb69e2..b6f0a7d1f0c 100644 --- a/script/linux-after-install.sh +++ b/script/linux-after-install.sh @@ -4,8 +4,8 @@ set -e 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)