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

Add ignorelist to pack command. #964

Merged
merged 3 commits into from
Aug 20, 2020
Merged

Conversation

obriat
Copy link

@obriat obriat commented Aug 14, 2020

Overview

This pull request:

  • Fixes a bug
  • Adds a feature
  • Breaks backwards compatibility
  • [x ] Has tests that cover changes
  • [ x] Adds or fixes documentation

Summary

Related to #961, allows to filter patterns when creating an archive.

Description

Files or folders could be excluded by using patterns, it's a good way to clean your package before delivery without touching you project folder tree.

<?php
$this->taskPack(<archiveFile>)
->add('project') 
->exclude(['dir/*.zip', '*.md'])
->run();

Good to know :
Zip allows regexp, glob or string, @see https://symfony.com/doc/current/components/finder.html#file-name.
Tar, gz and bz2 allow only regexp @see https://pear.php.net/package/Archive_Tar/docs/latest/Archive_Tar/Archive_Tar.html#methodsetIgnoreList.

Copy link
Member

@greg-1-anderson greg-1-anderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, address / answer two minor concerns & this should be good to merge.

@obriat obriat requested a review from greg-1-anderson August 19, 2020 19:45
Copy link
Member

@greg-1-anderson greg-1-anderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice before, but it looks like you hand-modified the Archive.md file, which is a generated file. To update the documentation in a persistent way, add the new instructions to the top of the file (e.g. Pack.php) and run ./robo docs to re-generate the documentation.

@obriat
Copy link
Author

obriat commented Aug 19, 2020

Ok, I fix the doc by adding the correct comments and running robo docs.
I rewrote the git history to have cleaner comments, but I now realise that's maybe not the correct way if you want to review my changes... (by the way I fix an example expression)

@greg-1-anderson
Copy link
Member

It's usually better to not rewrite history in a PR; I always squash-and-merge when done anyway. This PR is short enough that it wasn't an issue, though.

Thank you for contributing this.

@greg-1-anderson greg-1-anderson merged commit 390f74a into consolidation:main Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants