cocos2d / cocos2d-console

cocos2d command line tool
152 stars 190 forks source link

cocos compile not working for paths with whitespaces #331

Open hamburml opened 8 years ago

hamburml commented 8 years ago

Hi!

As stated I am unable to compile my project when the path to cocos2d-x, cocos project, ant and everything else needed contains a whitespace.

I tried to fix it myself (https://github.com/cocos2d/cocos2d-console/blob/v3/plugins/plugin_package/plugin_package.py#L39) but I can't find this file inside my cocos2d-console. I would have added quotes to the path but yeah.. the file doesn't exist (i am using cocos2d-x 3.8). I know I simply could remove the whitespaces but than I would need to change the settings in all other programms which I use. And to be honest, that doesn't fix the problem ;)

leiradel commented 8 years ago

I've added double quotes surrouding the path at build_android, line 183:

command = "%s update project -t %s -p \"%s\"" % (cocos.CMDRunner.convert_path_to_cmd(sdk_tool_path), target_str, manifest_path)

and now it works fine on Windows. I don't know what this change will do on Linux and Mac...

leiradel commented 8 years ago

Oops, talked too soon. There are other places where paths with spaces cause problems. I'll update this issue if I can fix them.

leiradel commented 8 years ago

I've added double quotes to lines 296, 299 and 301, but:

Android NDK: ERROR: You NDK_MODULE_PATH variable contains spaces
Android NDK: Please fix the error and start again.

I'll remove the whitespaces and be done with it.