Contribution: Fix for template/android/build_native.sh

Here’s a little fix for template/android/build_native.sh.

A potential problem happens when the filename of a resource being copied by the build_native.sh script has a space character in it.

Example: having “My Resource.png” in your resource folder causes the bash warning “binary operator expected” and fails to copy the file in the copy resources phase.

To fix it, simply enclose the $file variable in the copy resources for loop with double quotes:

# copy resources
for file in $RESOURCE_ROOT/*
do
    #echo $file
    if [ -d "$file" ]; then
        cp -rf "$file" $GAME_ANDROID_ROOT/assets
    fi

    if [ -f "$file" ]; then
        cp "$file" $GAME_ANDROID_ROOT/assets
    fi
done

Thank you.
Could you mind pull a request to cocos2dx?
The github address is https://github.com/cocos2d/cocos2d-x.git

Minggo. Thanks for all your work on Cocos2D-X! :slight_smile:

I just submitted a pull request. Although, I did not create a topic branch as GitHub suggests. Is it okay to send you pull requests as I did? Or must I create a topic branch? Any feedback here would really help, as I’d like to make it really easy for you.

From http://help.github.com/send-pull-requests/ :

Pull requests can be sent from any branch or commit but it’s recommended that a topic branch be used so that follow-up commits can be pushed to update the pull request if necessary.

Thank you Nat Weiss.

I have merged it.
Good work.