Skip to content

Conversation

@BrianHenryIE
Copy link
Member

@BrianHenryIE BrianHenryIE commented May 27, 2022

Specifying the output directory was not working as expected, as discussed in #34. e.g. "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"

Without a specified path or filename, the default output folder is the plugin's parent directory with the generated (versioned) filename.
Without a specified path, the default output folder is the plugin's parent directory with the specified filename.
With a specified path and filename, the archive is saved to that path and filename.
With a specified path and no filename, the archive is saved to that path with the generated (versioned) filename.

Tests added for:

  • wp dist-archive . hello-world.zip – output filename, no path
  • wp dist-archive . ./hello-world.zip – output filename, with . for path
  • wp dist-archive wp-content/plugins/hello-world wp-content – relative output path, no filename
  • wp dist-archive wp-content/plugins/hello-world ./subdir/hello-world.zip – relative output path, with filename
  • wp dist-archive . {RUN_DIR}/hello-world.zip – using . as input and absolute output path, with filename
  • wp dist-archive wp-content/plugins/hello-world . – using . as output path, no filename

No documentation changed.

Fixes #34

…ames

Without a specified path, the default output folder is the plugin's parent directory.
@BrianHenryIE BrianHenryIE requested a review from a team as a code owner May 27, 2022 01:31
@BrianHenryIE BrianHenryIE changed the title Fix #30 : Using relative paths with and without specified filenames Fix #34 : Using relative paths with and without specified filenames Jun 2, 2022
@BrianHenryIE
Copy link
Member Author

Related to issue #48, PR #49.

@schlessera schlessera added the bug label Jun 30, 2022
@schlessera schlessera added this to the 2.0.2 milestone Jun 30, 2022
@schlessera schlessera changed the title Fix #34 : Using relative paths with and without specified filenames Support relative paths with and without specified filenames Jun 30, 2022
@schlessera schlessera merged commit c7d253e into wp-cli:main Jun 30, 2022
BrianHenryIE added a commit to BrianHenryIE/dist-archive-command that referenced this pull request Jul 7, 2022
1. It seems `sys_get_temp_dir()` was being shared across multiple tests, so files already existed when subsequent tests were run.
2. Looks like the "no distignore file is present" test was failing after wp-cli#56 was merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Difficulties zipping current directory with correct paths

2 participants