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 24, 2018
1 parent 250fe4c commit 51e165d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
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
2 changes: 1 addition & 1 deletion src/Squirrel.nuspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<version>1.8.0</version>
<version>1.8.1</version>
<authors>GitHub</authors>
<owners>Paul Betts</owners>
<licenseUrl>https://github.com/squirrel/Squirrel.Windows/blob/master/COPYING</licenseUrl>
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
16 changes: 9 additions & 7 deletions src/Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,15 @@ 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();
var exeFiles = 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();
exeFiles.ForEachAsync(x => createExecutableStubForExe(x.FullName))
.Wait();
if (signingOpts == null) return;
Expand Down

0 comments on commit 51e165d

Please sign in to comment.