From 0b656af516b5b449acc5e262c47751a7c7e80908 Mon Sep 17 00:00:00 2001 From: overdodactyl <33071129+overdodactyl@users.noreply.github.com> Date: Sat, 25 Nov 2017 15:56:45 +0000 Subject: [PATCH] Update updater.sh Solution based off [here](https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx) --- updater.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/updater.sh b/updater.sh index ceb61bd..8c156e4 100644 --- a/updater.sh +++ b/updater.sh @@ -10,9 +10,12 @@ 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) -## greadlink is dependent on the package coreutils: brew install coreutils -scriptfullpath=$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}") +realpath_osx() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + +## get the full path of this script (readlink for readlink for Linux) +scriptfullpath=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || realpath "$0") ## change directory to the Firefox profile directory cd "$(dirname "${scriptfullpath}")"