From 5c04551567e14f0fc3d86422d0d6e731c4e16484 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 29 Dec 2011 10:39:46 +0800 Subject: [PATCH] fixed #910: when create new android project, not delete existing directory --- create-android-project.bat | 3 ++- create-android-project.sh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/create-android-project.bat b/create-android-project.bat index 184efd4079..6302474da5 100644 --- a/create-android-project.bat +++ b/create-android-project.bat @@ -23,8 +23,9 @@ set _NDKROOT=d:\programe\android\ndk\android-ndk-r6b if not exist "%_NDKROOT%" echo Couldn't find ndk at "%_NDKROOT%" & pause & exit 6 :: create android project -set /P _PACKAGEPATH=Please enter your package path: +set /P _PACKAGEPATH=Please enter your package path. For example: org.cocos2dx.example: set /P _PROJECTNAME=Please enter your project name: +if exist "%CD%\%_PROJECTNAME%" echo "%_PROJECTNAME%" exists, please use another name & pause & exit 7 echo "Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 & 3.0" echo "Other versions have not tested." call "%_ANDROIDTOOLS%\android.bat" list targets diff --git a/create-android-project.sh b/create-android-project.sh index ac03a51590..5f401ff1ad 100755 --- a/create-android-project.sh +++ b/create-android-project.sh @@ -59,6 +59,12 @@ create_android_project(){ echo "input your project name:" read PROJECT_NAME PROJECT_DIR=`pwd`/$PROJECT_NAME + + # check if PROJECT_DIR is exist + if [ -d $PROJECT_DIR ]; then + echo "$PROJECT_DIR is exist, please use another name" + exit + fi $ANDROID_SDK_ROOT_LOCAL/tools/android create project -n $PROJECT_NAME -t $TARGET_ID -k $PACKAGE_PATH -a $PROJECT_NAME -p $PROJECT_DIR }