Skip to content

Commit

Permalink
Find real script directory when run from symlink.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiota committed Jul 8, 2018
1 parent 41b52ea commit f880376
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gear360pano.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@


# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
DIR=$(dirname `which $0`)
WHICH=`which $0`
DIR=$(dirname `readlink -f $WHICH`)

SCRIPTNAME=$0
GALLERYDIR="html"
OUTDIR="$DIR/$GALLERYDIR/data"
Expand Down

0 comments on commit f880376

Please sign in to comment.