Closed pauby closed 3 years ago
@pauby Since Exclude
is treated as an array of regex patterns when Compile
is $true
, how about we make the behavior consistent when it's $false
as well? We can take that same logic and use Get-ChildItem
and exclude matches instead of Copy-Item
?
Thoughts?
Since Exclude is treated as an array of regex patterns when
Compile is $true
I didn't actually know that. Just checked it out and indeed it is! What is even more embarrassing is that I added it. Brain. Gone.
I agree that is the best option and makes it consistent.
At the moment it seems broken as well tbh.
When you don't pass any 'exclude' its an empty array.
So for each regex in this aray it checks for a '-notmatch'. But since the array is 0 it never checks for anything.
So before this little "hack" my "AllScripts" contains 2 files and after this it contains 0.
Before loop
After loop
The
Build.Exclude
configuration is simply an array of strings passed to theGet-ChildItem -Exclude
parameter. This is very inflexible and ... a little rubbish. If you try and exclude anything but file(s) it doesn't work.Expected Behavior
We should implement a
Build.ExcludePattern
and / orBuild.ExcludeWildcard
that allows the exclusion to match on a regular expression or wildcards.The names above are just examples.
Current Behavior
The
Build.Exclude
configuration is simply an array of strings passed to theGet-ChildItem -Exclude
parameter. This is very inflexible and ... a little rubbish. If you try and exclude anything but file(s) it doesn't work.Possible Solution
I'm happy to submit a PR for this but looking to get agreement on the specifics above.
Your Environment