You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2013/09/05 19:12:23 UTC
ios commit: [CB-4654] Allow default project template to be overridden
on create
Updated Branches:
refs/heads/master 609e88281 -> 437568128
[CB-4654] Allow default project template to be overridden on create
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/43756812
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/43756812
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/43756812
Branch: refs/heads/master
Commit: 437568128cbc014be820bc59a1816019deb1b6a3
Parents: 609e882
Author: Ian Clelland <ic...@chromium.org>
Authored: Thu Sep 5 13:11:51 2013 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Thu Sep 5 13:11:51 2013 -0400
----------------------------------------------------------------------
bin/create | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/43756812/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 461392e..244c8a9 100755
--- a/bin/create
+++ b/bin/create
@@ -31,12 +31,13 @@
set -e
function usage() {
- echo "Usage: $0 [--shared] [--arc] <path_to_new_project> <package_name> <project_name>"
+ echo "Usage: $0 [--shared] [--arc] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]"
echo " --shared (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it."
echo " --arc (optional): Enable ARC."
echo " <path_to_new_project>: Path to your new Cordova iOS project"
echo " <package_name>: Package name, following reverse-domain style convention"
echo " <project_name>: Project name"
+ echo " <project_template_dir>: Path to project template (override)."
exit 1
}
@@ -71,6 +72,7 @@ PROJECT_PATH=$1
PACKAGE=$2
PROJECT_NAME=$3
PROJECT_PARENT=$(dirname "$PROJECT_PATH")
+PROJECT_TEMPLATE_DIR=${4:-"$BINDIR/templates/project"};
# check whether the project path exists and is not empty
@@ -88,7 +90,7 @@ if [ ! -d "$PROJECT_PARENT" ]; then
fi
# copy the files in; then modify them
-cp -r "$BINDIR/templates/project/" "$PROJECT_PATH"
+cp -r "$PROJECT_TEMPLATE_DIR/" "$PROJECT_PATH"
# Copy in the JS.
cp "$CORDOVALIB_DIR/cordova.js" "$PROJECT_PATH/www/cordova.js"