From 6859df02fb166584f29d9c8fac3b0e0738a27410 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Mon, 25 Apr 2016 12:38:41 -0500 Subject: [PATCH] ... --- .../cpPlugins_Install_CMAKE.sh | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/third_party_installers/cpPlugins_Install_CMAKE.sh b/third_party_installers/cpPlugins_Install_CMAKE.sh index 61f0580..fafea8f 100755 --- a/third_party_installers/cpPlugins_Install_CMAKE.sh +++ b/third_party_installers/cpPlugins_Install_CMAKE.sh @@ -1,5 +1,23 @@ #!/bin/bash +function abspath() +{ + 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 +} + ## Some configuration variables number_of_processes="-j4" @@ -16,7 +34,7 @@ if [ "$#" -eq 1 ]; then echo "$0: Invalid file type." exit 1 fi - canonical_path=`readlink -e $1` + canonical_path=`abspath $1` source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build echo -n "Cleaning directories... " -- 2.45.1