Closed swissspidy closed 2 years ago
wp dist-archive . build.zip
works for me and creates build.zip
in the current directory.
wp dist-archive . ./scratch/build.zip
fails even though the scratch
folder exists:
Error: Target directory does not exist: ./scratch/build.zip
wp dist-archive . ./scratch/build.zip --create-target-dir
succeeds but the file is not placed in the subdirectory of .
, rather it's at ../scratch/build.zip
Besides #30 I found some other oddities when using
wp dist-archive
to build a ZIP of the current plugin in CI context (here's my current code: https://github.com/wearerequired/traduttore/pull/124)Right now it doesn't seem to be possible to zip the current directory either using
wp dist-archive "$(pwd)" build.zip
orwp dist-archive . build.zip
. Neither of which cases have a test case, FWIW.I also noticed inconsistencies between
wp dist-archive ./ build/test.zip --debug
andwp dist-archive ./ build.zip --debug
, where the latter uses an absolute path for the source directory but the former doesn't.Even more interestingly,
wp dist-archive ./ build.zip --debug
returns a success message, but when executing the actualzip
command that is shown when using--debug
, it errors.I shared my findings on Slack: https://wordpress.slack.com/archives/C02RP4T41/p1542835280388500
I'll try to find some time on Sunday or next week to write some tests for these scenarios and hopefully even come up with some fixes.
Related: https://github.com/wp-cli/wp-cli/issues/5007