There is an issue where the assets images were all corrupted in the generated Belt app. This is occurring because Belt reads files as utf-8 text and then writes them when copying. It isn't handling binary files appropriately. The only binary files I’m aware of right now are in templates/boilerplate/assets.
To reproduce the original issue, from Belt project dir:
node bin/belt.js NewApp
cd builds/NewApp
open assets/splash.png
# corrupted image
This updates the copyTemplateDirectory function to use fs.copy for binary files (currently defined using an array of filenames that we identify as binary, but we might want something more robust in the future) instead of reading the file, optionally transforming it, and then writing it.
There is an issue where the
assets
images were all corrupted in the generated Belt app. This is occurring because Belt reads files as utf-8 text and then writes them when copying. It isn't handling binary files appropriately. The only binary files I’m aware of right now are intemplates/boilerplate/assets
.To reproduce the original issue, from Belt project dir:
This updates the
copyTemplateDirectory
function to usefs.copy
for binary files (currently defined using an array of filenames that we identify as binary, but we might want something more robust in the future) instead of reading the file, optionally transforming it, and then writing it.