Fix formatting and coding style

This commit is contained in:
Janek Bevendorff 2017-02-01 01:03:30 +01:00
parent e12cd83b80
commit e31638d3dd
No known key found for this signature in database
GPG Key ID: CFEC2F6850BFFA53

View File

@ -245,19 +245,21 @@ checkTransifexCommandExists() {
} }
# re-implement realpath for OS X (thanks mschrag) # re-implement realpath for OS X (thanks mschrag)
# https://superuser.com/questions/205127/how-to-retrieve-the-absolute-path-of-an-arbitrary-file-from-the-os-x # https://superuser.com/questions/205127/
if $(command -v realpath > /dev/null); then if $(command -v realpath > /dev/null); then
realpath() { realpath() {
pushd . > /dev/null pushd . > /dev/null
if [ -d "$1" ]; then if [ -d "$1" ]; then
cd "$1"; dirs -l +0 cd "$1"
else cd "`dirname \"$1\"`" dirs -l +0
cur_dir=`dirs -l +0` else
cd "$(dirname "$1")"
cur_dir=$(dirs -l +0)
if [ "$cur_dir" == "/" ]; then if [ "$cur_dir" == "/" ]; then
echo "$cur_dir`basename \"$1\"`" echo "$cur_dir$(basename "$1")"
else else
echo "$cur_dir/`basename \"$1\"`" echo "$cur_dir/$(basename "$1")"
fi fi
fi fi
popd > /dev/null popd > /dev/null