ryanmaxwell / UncrustifyX

Uncrustify utility and documentation browser for Mac OS X
Other
586 stars 44 forks source link

mogenerator shell script update: universal location of mogenerator (fixe... #12

Closed Haryaalcar closed 10 years ago

Haryaalcar commented 10 years ago

fixes MacPort location in /opt/local/bin and any future isues of unknown mogenerator location

Haryaalcar commented 10 years ago
# Mogenerator Location
if [ -x /usr/local/bin/mogenerator ]; then
    echo "mogenerator exists in /usr/local/bin path";
    MOGENERATOR_DIR="/usr/local/bin";
elif [ -x /usr/bin/mogenerator ]; then
    echo "mogenerator exists in /usr/bin path";
    MOGENERATOR_DIR="/usr/bin";
else
    echo "mogenerator not found"; exit 1;
fi

changed to

# Mogenerator Location
MOGENERATOR_DIR=$(dirname $(which mogenerator) 2>/dev/null)

if [ ! -z $MOGENERATOR_DIR ]; then
    echo "mogenerator exists in $MOGENERATOR_DIR";
else
    echo "mogenerator not found"; exit 1;
fi
ryanmaxwell commented 10 years ago

Looks good... why did you close the pull request?