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)
# 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
realpath() {
pushd . > /dev/null
if [ -d "$1" ]; then
cd "$1"; dirs -l +0
else cd "`dirname \"$1\"`"
cur_dir=`dirs -l +0`
cd "$1"
dirs -l +0
else
cd "$(dirname "$1")"
cur_dir=$(dirs -l +0)
if [ "$cur_dir" == "/" ]; then
echo "$cur_dir`basename \"$1\"`"
echo "$cur_dir$(basename "$1")"
else
echo "$cur_dir/`basename \"$1\"`"
echo "$cur_dir/$(basename "$1")"
fi
fi
popd > /dev/null