Compile.lua script not removing .lu files on path with spaces

I noticed that on some Android projects I could see the (compiled) .lu files inside the assets folders.

I was pretty sure that they are not needed since they are all combined in the resources.car file during building.

After some digging, I found out that the issue is that the command do remove the .lu files is not properly escaping paths that have spaces.

The current command for non-windows machine is:

Compile.lua (line 378)

print( 'Removing: ' .. CORONA\_TARGET\_EXECUTABLE\_DIR .. '/\*.lu' ) local result = os\_execute(      'find -H', escape( CORONA\_TARGET\_EXECUTABLE\_DIR ), '-maxdepth 1 -name "\*.lu" -print', -- avoid cmd line length issues with "\*.lu"  '|', 'xargs rm -f')

but when you do a FIND, the paths will be printed to the console without the proper escaping.

So, if you do not want to have several unused files in your app, you have 2 options:

a ) Make sure that your project path does not have spaces

or

b ) Change the code above of compile.lua file (…/Corona Enterprise/Corona/shared/bin/Compile.lua) to escape the files path for you.  A modified version working version could be:

print( 'Removing: ' .. escape(CORONA\_TARGET\_EXECUTABLE\_DIR) .. '/\*.lu' ) local result = os.execute(     'find -H ' .. escape( CORONA\_TARGET\_EXECUTABLE\_DIR ) .. ' -maxdepth 1 -name "\*.lu" -print' .. -- avoid cmd line length issues with "\*.lu" ' |' .. " sed 's/ /\\\\ /g'" .. ' |' .. ' xargs rm -f')

Be aware that any change to the compile.lua file would be lost when you upgrade your Corona to a new version. Hopefully Corona folks will see this post and fix that issue on a future daily build.

UPDATE: This was fixed on Corona 2018.3194 daily build.

Can you file a bug report on this please to make sure we get it into our tracking system?

Thanks

Rob

Good Catch! Thanks!

EDIT: this will be fixed in next daily build

Can you file a bug report on this please to make sure we get it into our tracking system?

Thanks

Rob

Good Catch! Thanks!

EDIT: this will be fixed in next daily build