ryancramerdesign / ProcessExportProfile

Creates a site profile that can be used to install a new copy of ProcessWire.
http://processwire.com
20 stars 6 forks source link

Added Support for custom directories in Export #9

Closed ethanbeyer closed 2 years ago

ethanbeyer commented 7 years ago

@ryancramerdesign

Whenever I use this module, I begrudgingly go back in and paste some directories from site/assets like my SASS or JS files - and it has bugged me for a while.

So I forked with the intent of adding support for extra files.

On the first Settings page, I added a field to type in directories to add: screen shot 2016-12-06 at 18 04 08

Those values are turned into a JSON array and passed to a new Hidden field on the processInput page.

On ___executeCopy(), the array is looped through to make sure that the directories typed into Settings actually exist. If they do, they're copied.

On executeCopyZip(), I had to pass a second argument, which was the array of extra directories. Those are again looped through to be sure they're real, and then added to the .zip.