You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2012/08/14 00:13:07 UTC

[1/2] webworks commit: Allow for spaces in directory paths

Updated Branches:
  refs/heads/master 8b7a0c4e3 -> 33782b8c7


Allow for spaces in directory paths


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/33782b8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/33782b8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/33782b8c

Branch: refs/heads/master
Commit: 33782b8c749deac4d28d202d106310a2c9c4da81
Parents: aaeb70f
Author: Joshua Granick <jo...@joshuagranick.com>
Authored: Mon Aug 13 13:49:01 2012 -0700
Committer: Joshua Granick <jo...@joshuagranick.com>
Committed: Mon Aug 13 13:49:01 2012 -0700

----------------------------------------------------------------------
 bin/create |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/33782b8c/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index abce199..afb78cf 100755
--- a/bin/create
+++ b/bin/create
@@ -30,14 +30,14 @@ then
     exit 0
 fi
 
-BUILD_PATH=$( cd "$( dirname "$0" )/.." && pwd )
+BUILD_PATH="$( cd "$( dirname "$0" )/.." && pwd )"
 VERSION=$(cat "$BUILD_PATH/VERSION")
 
-PROJECT_PATH=${1:-"./example"}
+PROJECT_PATH="${1:-"./example"}"
 APPNAME=${2:-"cordovaExample"}
 
 # clobber any existing example
-if [ -d $PROJECT_PATH ]
+if [ -d "$PROJECT_PATH" ]
 then
     echo "Project already exists! Delete and recreate"
     exit 1
@@ -46,39 +46,39 @@ fi
 # cleanup after exit and/or on error
 function on_exit {
     echo "Cleaning up ..."
-    [ -d $BUILD_PATH/build ] && rm -rf $BUILD_PATH/build
-    [ -d $BUILD_PATH/dist ] && rm -rf $BUILD_PATH/dist
+    [ -d "$BUILD_PATH/build" ] && rm -rf "$BUILD_PATH/build"
+    [ -d "$BUILD_PATH/dist" ] && rm -rf "$BUILD_PATH/dist"
     echo "Remember to update the project.properties file inside your application directory!"
 }
 
 function on_error {
     echo "An error occured. Deleting project..."
-    [ -d $PROJECT_PATH ] && rm -rf $PROJECT_PATH
+    [ -d "$PROJECT_PATH" ] && rm -rf "$PROJECT_PATH"
 }
 
 # we do not want the script to silently fail
 trap on_error ERR
 trap on_exit EXIT
 
-ANT=$(which ant)
+ANT="$(which ant)"
 
-MANIFEST_PATH=$PROJECT_PATH/www/config.xml
+MANIFEST_PATH="$PROJECT_PATH/www/config.xml"
 
 # compile cordova.js and cordova.jar if in source, ignore if in distribution
-if [ ! -e $BUILD_PATH/www/ext/cordova-$VERSION.jar ] && [ -d $BUILD_PATH/framework ]
+if [ ! -e "$BUILD_PATH/www/ext/cordova-$VERSION.jar" ] && [ -d "$BUILD_PATH/framework" ]
 then
 	echo "Building cordova-$VERSION.jar and cordova-$VERSION.js ..."
-	(cd $BUILD_PATH && $ANT dist &> /dev/null )
+	(cd "$BUILD_PATH" && "$ANT" dist &> /dev/null )
 	
 	# copy project template
 	echo "Copying assets and resources ..."
-	cp -r $BUILD_PATH/dist/sample/. $PROJECT_PATH
+	cp -r "$BUILD_PATH/dist/sample/." "$PROJECT_PATH"
 else
 	# copy project template if in distribution
 	echo "Copying assets and resources ..."
-	cp -r $BUILD_PATH/sample/. $PROJECT_PATH
+	cp -r "$BUILD_PATH/sample/." "$PROJECT_PATH"
 fi
 
 # interpolate the app name into config.xml
 echo "Updating config.xml ..."
-sed -i '' -e "s/__NAME__/${APPNAME}/g" $MANIFEST_PATH
+sed -i '' -e "s/__NAME__/${APPNAME}/g" "$MANIFEST_PATH"