Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanek Bevendorff <janek@jbev.net>2017-01-31 21:25:15 +0300
committerJanek Bevendorff <janek@jbev.net>2017-01-31 21:25:15 +0300
commit040b4763595f9ee69b5249918e3d1760d402e242 (patch)
tree1ca62e77bcfda481e7aaeeee32512c1fed99e0f8 /release-tool
parentd7633f40baeca6ba288a62005c12ddbcc1f87923 (diff)
Manually implement realpath for OS X
Diffstat (limited to 'release-tool')
-rwxr-xr-xrelease-tool20
1 files changed, 20 insertions, 0 deletions
diff --git a/release-tool b/release-tool
index de5c723c9..11fdf501e 100755
--- a/release-tool
+++ b/release-tool
@@ -244,6 +244,26 @@ checkTransifexCommandExists() {
fi
}
+# 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
+if [ "$(uname -s)" == "Darwin" ]; then
+ realpath() {
+ pushd . > /dev/null
+ if [ -d "$1" ]; then
+ cd "$1"; dirs -l +0
+ else cd "`dirname \"$1\"`"
+ cur_dir=`dirs -l +0`
+
+ if [ "$cur_dir" == "/" ]; then
+ echo "$cur_dir`basename \"$1\"`"
+ else
+ echo "$cur_dir/`basename \"$1\"`"
+ fi
+ fi
+ popd > /dev/null
+ }
+fi
+
trap exitTrap SIGINT SIGTERM