andres-montanez/Magallanes — pull request #1 by javiereguiluz (2012-06-18 20:24:22+00:00)
Title: Tweaked current DIR detection

The `bin/mage` script doesn't work for me. The problem is the current DIR detection performed by the following lines:

SCRIPT=$(readlink $0)
DIR=$(dirname $SCRIPT)

Replacing those lines by the following solves the problem for me:

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Source: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in

Magallanes version: 0.9.10
OS: Mac OS X
Shell: zsh 4.3.9