Skip to content

Commit e44d14f

Browse files
committed
Update: Ensure we don't create stub for generated stub executables
1 parent 250fe4c commit e44d14f

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ local.properties
3737

3838
## Ignore Visual Studio temporary files, build results, and
3939
## files generated by popular Visual Studio add-ons.
40+
.vs
4041

4142
# User-specific files
4243
*.suo

src/Squirrel/Utility.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ public static IEnumerable<FileInfo> GetAllFilesRecursively(this DirectoryInfo ro
7474
{
7575
Contract.Requires(rootPath != null);
7676

77-
return rootPath.EnumerateFiles("*", SearchOption.AllDirectories);
77+
return rootPath.GetAllFilesRecursively("*");
78+
}
79+
80+
public static IEnumerable<FileInfo> GetAllFilesRecursively(this DirectoryInfo rootPath, string searchPattern)
81+
{
82+
Contract.Requires(rootPath != null);
83+
84+
return rootPath.EnumerateFiles(searchPattern, SearchOption.AllDirectories);
7885
}
7986

8087
public static IEnumerable<string> GetAllFilePathsRecursively(string rootPath)

src/Update/Program.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,14 @@ public void Releasify(string package, string targetDir = null, string packagesDi
392392

393393
var rp = new ReleasePackage(file.FullName);
394394
rp.CreateReleasePackage(Path.Combine(di.FullName, rp.SuggestedReleaseFileName), packagesDir, contentsPostProcessHook: pkgPath => {
395-
new DirectoryInfo(pkgPath).GetAllFilesRecursively()
396-
.Where(x => x.Name.ToLowerInvariant().EndsWith(".exe"))
397-
.Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe"))
398-
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
399-
.Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName))
400-
.ForEachAsync(x => createExecutableStubForExe(x.FullName))
401-
.Wait();
395+
new DirectoryInfo(pkgPath)
396+
.GetAllFilesRecursively("*.exe")
397+
.Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe"))
398+
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
399+
.Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName))
400+
.ToList()
401+
.ForEachAsync(x => createExecutableStubForExe(x.FullName))
402+
.Wait();
402403

403404
if (signingOpts == null) return;
404405

0 commit comments

Comments
 (0)