From 82c56030514009e377fc67d20efcf3556d656861 Mon Sep 17 00:00:00 2001 From: Xiaogang Date: Mon, 16 Jan 2023 15:37:56 +0800 Subject: [PATCH] Fixed the issue when support help and psd1 in {module}.Management folder Assume help folder and psd1 are in the same folder --- tools/Gen2Master/MoveFromGeneration2Master.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/Gen2Master/MoveFromGeneration2Master.ps1 b/tools/Gen2Master/MoveFromGeneration2Master.ps1 index c4d03cedde2d..af43b56f7769 100644 --- a/tools/Gen2Master/MoveFromGeneration2Master.ps1 +++ b/tools/Gen2Master/MoveFromGeneration2Master.ps1 @@ -259,7 +259,12 @@ Function Move-Generation2MasterHybrid { } #copy generated docs to help folder - Copy-Item -Path ("$SourcePath\{0}\docs\*" -f $submoduleDir.Name) -Destination "$DestPath\$ModuleName\help" -Filter *-* + #Assume psd1 and help are in the same folder. + $Psd1FolderPostfix = ''; + if (-not (Test-Path (Join-Path -Path (Join-Path -Path $DestPath -ChildPath $ModuleName) -ChildPath "Az.$ModuleName.psd1"))) { + $Psd1FolderPostfix = '.Management' + } + Copy-Item -Path ("$SourcePath\{0}\docs\*" -f $submoduleDir.Name) -Destination "$DestPath\$ModuleName$Psd1FolderPostfix\help" -Filter *-* #Region generate-info.json Here have a issue that user may not use latest version to generate the code. $generateInfo = @{} @@ -299,10 +304,6 @@ Function Move-Generation2MasterHybrid { dotnet sln $SolutionPath add (Join-Path -Path (Join-Path -Path $DestPath -ChildPath $submoduleDir.Name) -ChildPath Az.$submoduleName.csproj) # Update psd1 - $Psd1FolderPostfix = ''; - if (-not (Test-Path (Join-Path -Path (Join-Path -Path $DestPath -ChildPath $ModuleName) -ChildPath "Az.$ModuleName.psd1"))) { - $Psd1FolderPostfix = '.Management' - } $DestPsd1Path = Join-Path -Path (Join-Path -Path $DestPath -ChildPath $ModuleName$Psd1FolderPostfix) -ChildPath "Az.$ModuleName.psd1" $Psd1Metadata = Import-LocalizedData -BaseDirectory (Join-Path -Path $DestPath -ChildPath $ModuleName$Psd1FolderPostfix) -FileName "Az.$ModuleName.psd1" $SubModulePsd1MetaData = Import-LocalizedData -BaseDirectory (Join-Path -Path $SourcePath -ChildPath $submoduleDir.Name) -FileName "Az.$submoduleName.psd1"