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

Update: Ensure we don't create stub for generated stub executables #9

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ local.properties

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
.vs

# User-specific files
*.suo
Expand Down
9 changes: 8 additions & 1 deletion src/Squirrel/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ public static IEnumerable<FileInfo> GetAllFilesRecursively(this DirectoryInfo ro
{
Contract.Requires(rootPath != null);

return rootPath.EnumerateFiles("*", SearchOption.AllDirectories);
return rootPath.GetAllFilesRecursively("*");
}

public static IEnumerable<FileInfo> GetAllFilesRecursively(this DirectoryInfo rootPath, string searchPattern)
{
Contract.Requires(rootPath != null);

return rootPath.EnumerateFiles(searchPattern, SearchOption.AllDirectories);
}

public static IEnumerable<string> GetAllFilePathsRecursively(string rootPath)
Expand Down
15 changes: 8 additions & 7 deletions src/Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,14 @@ public void Releasify(string package, string targetDir = null, string packagesDi

var rp = new ReleasePackage(file.FullName);
rp.CreateReleasePackage(Path.Combine(di.FullName, rp.SuggestedReleaseFileName), packagesDir, contentsPostProcessHook: pkgPath => {
new DirectoryInfo(pkgPath).GetAllFilesRecursively()
.Where(x => x.Name.ToLowerInvariant().EndsWith(".exe"))
.Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe"))
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
.Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName))
.ForEachAsync(x => createExecutableStubForExe(x.FullName))
.Wait();
new DirectoryInfo(pkgPath)
.GetAllFilesRecursively("*.exe")
.Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe"))
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
.Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName))
.ToList()
.ForEachAsync(x => createExecutableStubForExe(x.FullName))
.Wait();

if (signingOpts == null) return;

Expand Down