Skip to content

Commit

Permalink
updater.sh - next attempt
Browse files Browse the repository at this point in the history
... at fixing the script path detection. should hopefully fix #264 (comment)
  • Loading branch information
earthlng authored Nov 25, 2017
2 parents 82d20c3 + 679ca59 commit 1789fea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@

### ghacks-user.js updater for Mac/Linux
## author: @overdodactyl
## version: 1.1
## version: 1.2

ghacksjs="https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js"

echo -e "\nThis script should be run from your Firefox profile directory.\n"

currdir=$(pwd)

## get the full path of this script (greadlink for Mac, readlink for Linux)
scriptfullpath=$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")
## get the full path of this script (readlink for Linux, greadlink for Mac with coreutils installed)
sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)

## fallback for Macs without coreutils
if [ -z "$sfp" ]; then sfp=${BASH_SOURCE[0]}; fi

## change directory to the Firefox profile directory
cd "$(dirname "${scriptfullpath}")"
cd "$(dirname "${sfp}")"

echo -e "Updating the user.js for Firefox profile:\n$(pwd)\n"

Expand Down

0 comments on commit 1789fea

Please sign in to comment.