wprig icon indicating copy to clipboard operation
wprig copied to clipboard

Corrupted files in bundled theme.

Open skywardpro opened this issue 1 year ago • 2 comments

Describe the bug WPRig 3.0.1 - 3.0.2 corrupts files on bundle.

To Reproduce Steps to reproduce the behavior:

  1. Download lates version or WPRig and "npm run rig-init"
  2. Go to bundled "wp-rig-test" theme folder
  3. Try to open screenshot.png in the root
  4. See that it's corrupted

Expected behavior Files should be copied to bundled theme "as it is", without any changes and not being corrupted.

Desktop (please complete the following information):

  • Windows 11 Pro 24H2

Additional context Same happens with additional files to copy (e.g. create custom folder with video or fonts in assets and try to copy it to bundle, it also appears corrupted). But text files like readme or license which also copied as separate files are not corrupted. Seems it happens only with graphics.

Image

skywardpro avatar Feb 01 '25 13:02 skywardpro

I was able to fix it without relying on pump. It's probably something with streams or how Gulp works with them in new version

Here is a quick solution for prodPred.js file (attached as .txt)

prodPrep.js.txt

Due to its a "quickfix" I haven't opened pull request. I hope there should be another, more optimal solution and someone from contributors can fix it saving native logic.

skywardpro avatar Feb 01 '25 15:02 skywardpro

It was found that WPRIg brokes only files which are the part of filesToCopy list in theme config file e.g. screenshot.png in the root of theme, custom fonts and videos which have been added in by me in my custom wprig theme.

I fixes it by changing the logic of copying these files without any minification and opened pull request: https://github.com/wprig/wprig/pull/882

skywardpro avatar Apr 16 '25 07:04 skywardpro