terraform-provider-archive
terraform-provider-archive copied to clipboard
archive_file: add regex to excludes
Adds basic asterisk notation regex for excludes attribute, to be able to consider files/dir prefix and suffix.
@manasouza - I've checked the PR can you explain the below to me.
You're replacing the * with .* right? How would this work in the example of pycache from Python?
This does not work
excludes = ["__pycache__"]
It could be done like either of these two...
excludes = ["__pycache__/*"]
excludes = ["./__pycache__"]
I don't believe the below code is addressing the above use case?
} else if strings.Contains(exclude, "*") {
if matches, _ := regexp.MatchString("^"+strings.Replace(exclude, "*", ".*", -1), fileName); matches {
return true
}
}
excludes = ["__pycache__"]excludes = ["__pycache__/*"] excludes = ["./__pycache__"]
Right. I suppose it covers all the use cases you mentioned.
Do you think is there any additional coverage needed beyond the explored by TestZipArchiver_Dir_Exclude_Prefix_Regex_With_Directory and TestZipArchiver_Dir_Exclude_Suffix_Regex_With_Directory ?
Thank you for for the PR, @manasouza! That is very useful feature. @appilon @findkim @paultyng Could you please review it?
I've been wishing for this feature today – any chance of it being reviewed soon? 🙏
Also wishing I had this feature today. Terragrunt creates a lot of extra files that end up in packaged resources, which change their sums. Causes erogenous re-deployments.
Being about to wildcard exclude would solve that.
I would like to know about this feature. I really wish this.