Skip to content

Commit

Permalink
Update: Ensure we don't create stub for generated stub executables
Browse files Browse the repository at this point in the history
  • Loading branch information
IonMiron committed Jul 30, 2018
1 parent 250fe4c commit e44d14f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
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
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
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

0 comments on commit e44d14f

Please sign in to comment.