wp-cli / dist-archive-command

Create a distribution .zip or .tar.gz based on a plugin or theme's .distignore file
https://developer.wordpress.org/cli/commands/dist-archive/
MIT License
48 stars 24 forks source link

Allow for leading slashes in .distignore, and deal gracefully with symlinks #61

Closed BrianHenryIE closed 2 years ago

BrianHenryIE commented 2 years ago

This is tests and fixes for PRs #58 and #59.

The tests for 58 were relevant to those needed for 59. The code in 59 fixed some of the issue in 58.

Closes #57 and #47.

PHPUnit tests are added to this repo for the first time and should be helpful for work that might be done on #15 and #44.

BrianHenryIE commented 2 years ago

Dammit, tests working locally on MacOS and not on GitHub Actions!

Syntax differences between tar on different systems?

BrianHenryIE commented 2 years ago

I needed to use php_uname( 's' ) to test for Linux because tar's syntax and flags differ between MacOS and Linux.

tar's --anchored is not available on MacOS. On MacOS tar, to anchor, exclusions are written beginning with ^ regex character.

danielbachhuber commented 2 years ago

Thanks @BrianHenryIE, appreciate your work on this.

I'll review this at depth when I have some time in the near future.