You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/07/30 21:58:36 UTC

[13/15] ios commit: Fixed bin/create to detect both symlinks and regular paths

Fixed bin/create to detect both symlinks and regular paths


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/6e7ff96e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/6e7ff96e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/6e7ff96e

Branch: refs/heads/master
Commit: 6e7ff96e10d5ed3f610df0cf03a5ce2ec3e3f68e
Parents: cfa66b5
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Jul 25 18:01:15 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Jul 30 12:52:25 2012 -0700

----------------------------------------------------------------------
 bin/create |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/6e7ff96e/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index cf29516..349b2b8 100755
--- a/bin/create
+++ b/bin/create
@@ -44,8 +44,13 @@ if [ $# -lt 3 ]; then
 fi
 
 # the two lines below are to get the current folder, and resolve symlinks
-SCRIPT=`readlink $0`
-BINDIR=`dirname $SCRIPT`
+SCRIPT="$0"
+# need this for relative symlinks
+while [ -h "$SCRIPT" ] ; do
+   SCRIPT=`readlink "$SCRIPT"`
+done
+
+BINDIR=$( cd "$( dirname "$SCRIPT" )" && pwd )
 
 PROJECT_PATH=$1
 PACKAGE=$2