You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/07/17 04:01:56 UTC

ios commit: Check the parent path exists in create so cp -r does not fail

Updated Branches:
  refs/heads/master 08b176546 -> 5b49e14d0


Check the parent path exists in create so cp -r does not fail

Without this, the script prints out a screen full of error messages.


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

Branch: refs/heads/master
Commit: 5b49e14d0662e131bbf1ebc6b687179bf66a40e3
Parents: 08b1765
Author: Tim Robertson <tr...@netspend.com>
Authored: Wed Jul 10 20:32:29 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Jul 16 22:01:09 2013 -0400

----------------------------------------------------------------------
 bin/create | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/5b49e14d/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index bbaaaf2..461392e 100755
--- a/bin/create
+++ b/bin/create
@@ -70,6 +70,8 @@ CDV_VER=$(cat "$CORDOVALIB_DIR/VERSION")
 PROJECT_PATH=$1
 PACKAGE=$2
 PROJECT_NAME=$3
+PROJECT_PARENT=$(dirname "$PROJECT_PATH")
+
 
 # check whether the project path exists and is not empty
 if [ -d "$PROJECT_PATH" ]; then
@@ -79,6 +81,12 @@ if [ -d "$PROJECT_PATH" ]; then
 	fi
 fi
 
+#Ensure the parent directory exists so cp -r will not fail
+if [ ! -d "$PROJECT_PARENT" ]; then
+	echo "\033[31mError: $PROJECT_PARENT does not exist. Please specify an existing parent folder.\033[m"
+	exit 1
+fi
+
 # copy the files in; then modify them
 cp -r "$BINDIR/templates/project/" "$PROJECT_PATH"