mirror of
https://github.com/arkenfox/user.js.git
synced 2025-02-23 10:53:57 +00:00
fix for profile detection
this should now work no matter how the script is called (including symlinks) on both Mac and Linux. + Storing and restoring the original working directory to prevent problems in certain circumstances.
This commit is contained in:
parent
7ae034a23c
commit
500c129d48
17
updater.sh
17
updater.sh
@ -2,14 +2,22 @@
|
|||||||
|
|
||||||
### ghacks-user.js updater for Mac/Linux
|
### ghacks-user.js updater for Mac/Linux
|
||||||
## author: @overdodactyl
|
## author: @overdodactyl
|
||||||
## version: 1.0
|
## version: 1.1
|
||||||
|
|
||||||
ghacksjs="https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js"
|
ghacksjs="https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js"
|
||||||
|
|
||||||
cd "`dirname $0`"
|
|
||||||
|
|
||||||
echo -e "\nThis script should be run from your Firefox profile directory.\n"
|
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]}")
|
||||||
|
|
||||||
|
## change directory to the Firefox profile directory
|
||||||
|
cd "$(dirname "${scriptfullpath}")"
|
||||||
|
|
||||||
|
echo -e "Updating the user.js for Firefox profile:\n$(pwd)\n"
|
||||||
|
|
||||||
if [ -e user.js ]; then
|
if [ -e user.js ]; then
|
||||||
echo "Your current user.js file for this profile will be backed up and the latest ghacks version from github will take its place."
|
echo "Your current user.js file for this profile will be backed up and the latest ghacks version from github will take its place."
|
||||||
echo -e "\nIf currently using the ghacks user.js, please compare versions:"
|
echo -e "\nIf currently using the ghacks user.js, please compare versions:"
|
||||||
@ -42,3 +50,6 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|||||||
else
|
else
|
||||||
echo "Process aborted"
|
echo "Process aborted"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## change directory back to the original working directory
|
||||||
|
cd "${currdir}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user