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

Feature request: Ability to exclude files/directories from the archive #8

Closed
fewstera opened this issue Jun 9, 2016 · 8 comments · Fixed by #35
Closed

Feature request: Ability to exclude files/directories from the archive #8

fewstera opened this issue Jun 9, 2016 · 8 comments · Fixed by #35

Comments

@fewstera
Copy link
Contributor

fewstera commented Jun 9, 2016

Thanks for the great tool.

It would be great if it was possible to exclude files from being added to the source archive.

@robinjmurphy
Copy link
Contributor

This sounds like a good feature. Is this something you'd be up for contributing? We can try and pick it up soon if not.

Should be easy to do as we already ignore some files https://github.com/bbc/speculate/blob/master/lib/archiver.js#L9-L11.

@fewstera
Copy link
Contributor Author

fewstera commented Jun 9, 2016

We can pick this up. I'll submit a PR when I get time 👍

@lukejpreston
Copy link

lukejpreston commented Mar 29, 2017

I am having a look at doing this now

it currently uses regex var IGNORE_REGEX = /SOURCES|SPECS|RPMS|SRPMS|\.git/;

should it extend this in the package.json with a value like

"spec": {
  "exclude": ["pattern_1", "pattern_2"] OR "regex_pattern"
}

or did you guys have something else in mind?

@lukejpreston
Copy link

an alternative would be to specifiy what you wanted to package

"spec": {
  "entries": ["file1", "subdir/file2"]
}

and another option

read the package.json values for

only and also use the .npmignore file if one exists, along with the regex you have

which are all standard npm things people can use

also should that regex also include the build folder which is generated?

@jasonwilliams
Copy link

Lets not make it too magic, a simple excludes:[] is all we need for now.
Then we'll have to try and extend the IGNORE_REGEX or have something similar

@Mousius
Copy link
Contributor

Mousius commented Jun 11, 2017

I think it'd be nicer to have package.json work as normally as possible, the spec section should really be for things we can't achieve easily with a normal package.json file.

Given that, I think we'd only have to implement directories and maybe files to start with as a generic "add these things to the RPM" for any of the given keys and see if there's anything further people want afterwards?

PRs always welcome 😸

@lukejpreston
Copy link

lukejpreston commented Jun 12, 2017

I am a fan of project config being put into the package.json, things like eslint, jest and webpack do this and it feels natural and nice

That said I haven't pursued it any further, the project I was working that was using this got canned and I don't have time to look into it

@Mousius
Copy link
Contributor

Mousius commented Mar 22, 2018

This is now in 2.0.0-alpha.1 if anyone wants to try it out 😸

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 a pull request may close this issue.

5 participants