Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore cmdlet check when it doesn't come from assembly file #13642

Merged
merged 3 commits into from
Dec 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tools/VersionController/Models/VersionMetadataHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public Version GetVersionBumpUsingSerialized(bool serialize = true)
{
powershell.AddScript("(Test-ModuleManifest -Path " + outputModuleManifestPath + ").NestedModules");
var cmdletResult = powershell.Invoke();
nestedModules = cmdletResult.Select(c => c.ToString() + ".dll");
nestedModules = cmdletResult.Select(c => c.ToString());
}

Version versionBump = Version.PATCH;
Expand All @@ -290,9 +290,17 @@ public Version GetVersionBumpUsingSerialized(bool serialize = true)
}

requiredModules.Add(outputModuleDirectory);
foreach (var nestedModule in nestedModules)
foreach (var nestedModuleName in nestedModules)
{
// Handcrafted modules assume its nested module always is DLL file.
var nestedModule = nestedModuleName + ".dll";
var assemblyPath = Directory.GetFiles(outputModuleDirectory, nestedModule, SearchOption.AllDirectories).FirstOrDefault();

// However we support PSM1, PSD1 other nested module type. Skip this check and we need to use a different design soon.
if(assemblyPath == null)
{
continue;
}
var proxy = new CmdletLoader();
var newModuleMetadata = proxy.GetModuleMetadata(assemblyPath, requiredModules);
var serializedCmdletName = nestedModule + ".json";
Expand Down