Skip to content

Commit

Permalink
v2.5.3 Enforces execution permission after installs and upgrades (chmod)
Browse files Browse the repository at this point in the history
  • Loading branch information
tavinus committed Apr 4, 2020
1 parent e7c7062 commit 27f6597
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pdfScale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
################################################################

VERSION="2.5.2"
VERSION="2.5.3"


###################### EXTERNAL PROGRAMS #######################
Expand Down Expand Up @@ -768,6 +768,7 @@ selfInstall() {
fi
if [[ $NEED_SUDO -eq $TRUE ]]; then
if sudo cp "$CURRENT_LOC" "$TARGET_LOC"; then
sudo chmod +x "$TARGET_LOC"
echo $'\nSuccess! Program installed!'
echo " > $TARGET_LOC"
exit $EXIT_SUCCESS
Expand All @@ -777,6 +778,7 @@ selfInstall() {
fi
fi
if cp "$CURRENT_LOC" "$TARGET_LOC"; then
chmod +x "$TARGET_LOC"
echo $'\nSuccess! Program installed!'
echo " > $TARGET_LOC"
exit $EXIT_SUCCESS
Expand All @@ -793,6 +795,7 @@ selfInstall() {
if [[ "$_answer" = "y" || "$_answer" = "yes" ]]; then
NEED_SUDO=$TRUE
if sudo cp "$CURRENT_LOC" "$TARGET_LOC"; then
sudo chmod +x "$TARGET_LOC"
echo $'\nSuccess! Program installed!'
echo " > $TARGET_LOC"
exit $EXIT_SUCCESS
Expand Down Expand Up @@ -945,6 +948,7 @@ selfUpgrade() {
if [[ "$_answer" = "y" || "$_answer" = "yes" ]]; then
echo "Upgrading..."
if cp "./pdfScale.sh" "$CURRENT_LOC" 2>/dev/null; then
chmod +x "$CURRENT_LOC"
exitUpgrade $'\n'"Success! Upgrade finished!"$'\n'" > $CURRENT_LOC" $EXIT_SUCCESS
else
_answer="no"
Expand All @@ -960,6 +964,7 @@ selfUpgrade() {
if [[ "$_answer" = "y" || "$_answer" = "yes" ]]; then
echo "Upgrading with sudo..."
if sudo cp "./pdfScale.sh" "$CURRENT_LOC" 2>/dev/null; then
sudo chmod +x "$CURRENT_LOC"
exitUpgrade $'\n'"Success! Upgrade finished!"$'\n'" > $CURRENT_LOC" $EXIT_SUCCESS
else
exitUpgrade "There was an error when copying the new version."
Expand Down

0 comments on commit 27f6597

Please sign in to comment.