Skip to content

Commit

Permalink
Ignore cmdlet check when it doesn't come from assembly file (#13642)
Browse files Browse the repository at this point in the history
Co-authored-by: Yunchi Wang <[email protected]>
  • Loading branch information
dingmeng-xue and wyunchi-ms authored Dec 2, 2020
1 parent 099b48f commit 5c9ad60
Showing 1 changed file with 10 additions and 2 deletions.
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

0 comments on commit 5c9ad60

Please sign in to comment.