Skip to content

Commit 51e165d

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

4 files changed

Lines changed: 19 additions & 9 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.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
4-
<version>1.8.0</version>
4+
<version>1.8.1</version>
55
<authors>GitHub</authors>
66
<owners>Paul Betts</owners>
77
<licenseUrl>https://github.com/squirrel/Squirrel.Windows/blob/master/COPYING</licenseUrl>

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: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,15 @@ 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+
var exeFiles = 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+
402+
exeFiles.ForEachAsync(x => createExecutableStubForExe(x.FullName))
403+
.Wait();
402404

403405
if (signingOpts == null) return;
404406

0 commit comments

Comments
 (0)