Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly ignore distribution archive files #15

Open
danielbachhuber opened this issue Jan 5, 2017 · 5 comments
Open

Correctly ignore distribution archive files #15

danielbachhuber opened this issue Jan 5, 2017 · 5 comments

Comments

@danielbachhuber
Copy link
Member

Files like *.zip and *.tar.gz shouldn't be included in distribution builds.

From wp-cli/wp-cli#3520 and wp-cli/scaffold-package-command#66

@santilin
Copy link

santilin commented Apr 18, 2019

I wonder why this command uses a separate .distignore file to ignore files and it doesn't use the export-ignore flag in .gitattributes.

If there has been a discussion first about this, please let me know.

@schlessera
Copy link
Member

WP-CLI is focused on WordPress plugins, not git repositories. The official plugin repository, for example, still uses SVN, not git.

I think it would make sense, though, to investigate the possibility to have the dist-archive command fall back to interpret .gitattributes if the .distignore is missing.

@santilin
Copy link

To use the .gitattributes the approach is different. In that case, and provided that you have a git repository, you have to use git archive witch handles all the exclusions and can create a .zip or a .tar.gz.

So, probably the best way is to tell dist-archive in advance if we want to use git to make the archive and if true use .gitattributes, or else use .distignore.

@santilin
Copy link

Anyway, I would like to argue that it shouldn't be the responsibility of dist-archive command to tell if a .tar.gz or a .zip file should be in the archive, but the responsibility of the maintainer to add those files to .distignore.

If dist-archive doesn't include archived files, the plugin might be unable to include some required files, like, for example, compressed font files or any other kind of data that the plugin needs.

@BrianHenryIE
Copy link
Member

BrianHenryIE commented Jun 20, 2022

I asked about this on Slack and while .org does not "allow compressed files like zips, tar, etc, in a plugin", I think this CLI command is really used for non .org deployments, so their "rules" aren't so relevant.

I think the scaffold-package-command is more targeted at .org plugins than this command, so adding the default exclusions is appropriate there.

I do think *.zip, *.tar should be added to the documentation showing a default .distignorein the README, and a *.zip (i.e. a *.something) test added to the test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants