Update updater.sh

now you can use SCRIPT_DIR in update_updater instead of $currdir because $currdir could be anything
This commit is contained in:
earthlng 2018-11-22 22:24:11 +00:00 committed by GitHub
parent 8a2d5891fe
commit 3fe46385cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,14 @@
## Author: Pat Johnson (@overdodactyl)
## Additional contributors: @earthlng, @ema-pe
## DON'T GO HIGHER THAN VERSION x.9 !! ( because of ASCII comparison in check_for_update() )
## DON'T GO HIGHER THAN VERSION x.9 !! ( because of ASCII comparison in update_updater() )
readonly currdir=$(pwd)
sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
if [ -z "$sfp" ]; then sfp=${BASH_SOURCE[0]}; fi
readonly SCRIPT_DIR="$(dirname "${sfp}")"
#########################
# Base variables #
@ -36,11 +43,8 @@ PROFILE_PATH=false
#########################
set_wd () {
currdir=$(pwd)
if [ "$PROFILE_PATH" = false ]; then
sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
if [ -z "$sfp" ]; then sfp=${BASH_SOURCE[0]}; fi
ff_profile="$(dirname "${sfp}")"
ff_profile="$SCRIPT_DIR"
elif [ "$PROFILE_PATH" = "list" ]; then
if [ "$(uname)" == "Darwin" ]; then
firefox_dir=~/Library/Application\ Support/Firefox/Profiles/
@ -59,7 +63,7 @@ set_wd () {
else
ff_profile="$PROFILE_PATH"
fi
cd "$ff_profile"
cd "$ff_profile"
}
#########################