Skip to content

Commit ad4dbfc

Browse files
authored
Merge pull request #1121 from gep13/issue-1120
(#1120) Fix gathering of files for signing
2 parents 570a415 + e0b6367 commit ad4dbfc

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

recipe.cake

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,40 @@ Func<FilePathCollection> getScriptsToVerify = () =>
3232
Information(scriptToVerify.FullPath);
3333
}
3434

35+
var numberOfScriptsToVerify = scriptsToVerify.Count();
36+
37+
if (numberOfScriptsToVerify != 3)
38+
{
39+
throw new Exception(string.Format("Expected to find 3 scripts to verify, but found {0}", numberOfScriptsToVerify));
40+
}
41+
3542
return scriptsToVerify;
3643
};
3744

3845
Func<FilePathCollection> getScriptsToSign = () =>
3946
{
40-
var scriptsToSign = GetFiles("./nuspec/**/*.{ps1|psm1|psd1}");
47+
var scriptsToSign = GetFiles(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/**/*.{ps1|psm1|psd1}");
4148

4249
Information("The following PowerShell scripts have been selected to be signed...");
4350
foreach (var scriptToSign in scriptsToSign)
4451
{
4552
Information(scriptToSign.FullPath);
4653
}
4754

55+
var numberOfScriptsToSign = scriptsToSign.Count();
56+
57+
if (numberOfScriptsToSign != 3)
58+
{
59+
throw new Exception(string.Format("Expected to find 3 scripts to verify, but found {0}", numberOfScriptsToSign));
60+
}
61+
4862
return scriptsToSign;
4963
};
5064

5165
Func<FilePathCollection> getFilesToSign = () =>
5266
{
53-
var filesToSign = GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/^{ChocolateyGui|ChocolateyGuiCli}/{ChocolateyGui|ChocolateyGuiCli}*.{exe|dll}") +
54-
GetFiles(BuildParameters.Paths.Directories.PublishedLibraries + "/ChocolateyGui*/ChocolateyGui*.dll");
67+
var filesToSign = GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/^{ChocolateyGui|ChocolateyGuiCli}/net48/{ChocolateyGui|ChocolateyGuiCli}*.{exe|dll}") +
68+
GetFiles(BuildParameters.Paths.Directories.PublishedLibraries + "/ChocolateyGui*/net48/ChocolateyGui*.dll");
5569

5670
var platformTarget = ToolSettings.BuildPlatformTarget == PlatformTarget.MSIL ? "AnyCPU" : ToolSettings.BuildPlatformTarget.ToString();
5771
foreach(var project in ParseSolution(BuildParameters.SolutionFilePath).GetProjects())
@@ -88,6 +102,13 @@ Func<FilePathCollection> getFilesToSign = () =>
88102
Information(fileToSign.FullPath);
89103
}
90104

105+
var numberOfFilesToSign = filesToSign.Count();
106+
107+
if (numberOfFilesToSign != 13)
108+
{
109+
throw new Exception(string.Format("Expected to find 13 files to sign, but found {0}", numberOfFilesToSign));
110+
}
111+
91112
return filesToSign;
92113
};
93114

@@ -101,6 +122,13 @@ Func<FilePathCollection> getMsisToSign = () =>
101122
Information(msiToSign.FullPath);
102123
}
103124

125+
var numberOfMsisToSign = msisToSign.Count();
126+
127+
if (numberOfMsisToSign != 1)
128+
{
129+
throw new Exception(string.Format("Expected to find 1 msis to sign, but found {0}", numberOfMsisToSign));
130+
}
131+
104132
return msisToSign;
105133
};
106134

0 commit comments

Comments
 (0)