Skip to content

Commit

Permalink
Prevent source directories from being harvested.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Apr 4, 2024
1 parent 289c93d commit 765036d
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 207 deletions.
1 change: 1 addition & 0 deletions src/internal/SetBuildNumber/Directory.Packages.props.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PackageVersion Include="WixToolset.Dtf.CustomAction" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Dtf.Resources" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Dtf.WindowsInstaller" Version="{packageversion}" />
<PackageVersion Include="WixToolset.Dtf.WindowsInstaller.Package" Version="{packageversion}" />

<PackageVersion Include="WixInternal.TestSupport" Version="{packageversion}" />
<PackageVersion Include="WixInternal.TestSupport.Native" Version="{packageversion}" />
Expand Down
4 changes: 2 additions & 2 deletions src/wix/WixToolset.Core/HarvestFilesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void HarvestFiles(HarvestFilesSymbol harvestFile, IntermediateSection se
private IEnumerable<WildcardFile> GetWildcardFiles(HarvestFilesSymbol harvestFile, IEnumerable<string> patterns)
{
var sourceLineNumbers = harvestFile.SourceLineNumbers;
var sourcePath = harvestFile.SourcePath;
var sourcePath = harvestFile.SourcePath?.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);

var files = new List<WildcardFile>();

Expand Down Expand Up @@ -158,7 +158,7 @@ private IEnumerable<WildcardFile> GetWildcardFiles(HarvestFilesSymbol harvestFil
else if (!Path.IsPathRooted(directoryPortion))
{
directoryPortion = Path.Combine(sourceDirectory, directoryPortion);
recursiveDirOffset = sourceDirectory.Length + 1;
recursiveDirOffset = directoryPortion.Length + 1;
}

var foundFiles = Directory.EnumerateFiles(directoryPortion, filePortion, recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
Expand Down
Loading

0 comments on commit 765036d

Please sign in to comment.