File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
tools/VersionController/Models Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,11 @@ private void UpdateOutputModuleManifest(List<string> releaseNotes)
461
461
script += getRequiredModulesScript ;
462
462
script += $ "$env:PSModulePath+=\" ;{ _fileHelper . OutputResourceManagerDirectory } \" ;";
463
463
script += "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process;" ;
464
- script += "Update-ModuleManifest -Path " + tempModuleManifestPath + " -ModuleVersion " + _newVersion + " -ReleaseNotes $releaseNotes" + " -RequiredModules $requiredmodules;" ;
464
+ script += "if ($requiredModules.Count -gt 0){" +
465
+ "Update-ModuleManifest -Path " + tempModuleManifestPath + " -ModuleVersion " + _newVersion + " -ReleaseNotes $releaseNotes" + " -RequiredModules $requiredModules" +
466
+ "}else {" +
467
+ "Update-ModuleManifest -Path " + tempModuleManifestPath + " -ModuleVersion " + _newVersion + " -ReleaseNotes $releaseNotes" +
468
+ "};" ;
465
469
script += "$?" ;
466
470
467
471
using ( PowerShell powershell = PowerShell . Create ( ) )
@@ -472,7 +476,9 @@ private void UpdateOutputModuleManifest(List<string> releaseNotes)
472
476
if ( result . Count > 0 &&
473
477
( ! bool . TryParse ( result . Last ( ) ? . ToString ( ) , out exitcode ) ) || ! exitcode )
474
478
{
475
- Console . WriteLine ( $ "Found error in updating module { _fileHelper . ModuleName } : { powershell . Streams . Error . First ( ) ? . ToString ( ) } ") ;
479
+ var errorMsg = $ "Found error in updating module { _fileHelper . ModuleName } : { powershell . Streams . Error . First ( ) ? . ToString ( ) } ";
480
+ _logger . LogError ( errorMsg ) ;
481
+ throw new Exception ( errorMsg ) ;
476
482
}
477
483
}
478
484
You can’t perform that action at this time.
0 commit comments