openfl / hxp

Write scripts in Haxe, and execute them on Windows, macOS or Linux
MIT License
58 stars 19 forks source link

Macros need escaping for bash shell #5

Open Aidan63 opened 5 years ago

Aidan63 commented 5 years ago

Hello, I've recently came across two issues for macros with the hxp.HXML class. The first is that addMacro only adds one dash for the macro flag when it should be a double dash.

Once that one character modification has been made the second issue is that the brackets in macro functions need to be escaped for bash. Currently macros are simple appended to the HXML array e.g. --macro snow.Set.config("config.json") but this causes the bash: syntax error near unexpected token('\ error on linux when calling build. To get around this macro brackets should to be escaped e.g. --macro snow.Set.config\("config.json"\).

Thanks