From 33d2ad2ac3da85a9aa064c974ff6183404227cfa Mon Sep 17 00:00:00 2001 From: Curtis Adkins Date: Fri, 24 Mar 2017 20:50:10 -0400 Subject: [PATCH] Made it so packt.sh can be ran from any directory. Adding BASH_SOURCE to get the directory of the calling script --- packt.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packt.sh b/packt.sh index dce2c7a..def9d2a 100755 --- a/packt.sh +++ b/packt.sh @@ -2,7 +2,9 @@ # Packt daily free e-book claim & download -source "packt.cfg" +CONFIG_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +source "$CONFIG_DIR/packt.cfg" function log { echo "$(date '+%Y-%m-%d %H:%M:%S ') $1" >> "$log"