Skip to content

Commit

Permalink
Sync tools folder from main branch to generation branch (#24377)
Browse files Browse the repository at this point in the history
Co-authored-by: azurepowershell <azurepowershell@ms.com>
  • Loading branch information
azure-powershell-bot and azurepowershell authored Mar 16, 2024
1 parent 80267c5 commit d01fa1f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/Gen2Master/MoveFromGeneration2Master.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ Function Move-Generation2Master {
Copy-Item -Recurse -Path $SourceItem -Destination $DestItem
}
}
$sourceHelpFolder = Join-Path -Path (Join-Path -Path $SourcePath -ChildPath $submoduleDir.Name) -ChildPath "docs"
$destHelpHolder = Join-Path -Path (Join-Path -Path $DestPath -ChildPath $ModuleName) -ChildPath "help"
Write-Host "Copying help files from $sourceHelpFolder to $destHelpHolder" -ForegroundColor Yellow
Get-ChildItem -Path $sourceHelpFolder -Filter *-*.md | Copy-Item -Destination $destHelpHolder
#Region Clean Local Modules
$LocalModulesPath = Join-Path -Path (Join-Path -Path (Join-Path -Path $DestPath -ChildPath $submoduleDir.Name) -ChildPath 'generated') -ChildPath 'modules'
If (Test-Path $LocalModulesPath) {
Expand Down Expand Up @@ -130,6 +134,7 @@ Function Move-Generation2Master {
}
$Psd1Metadata.Remove("PrivateData")
}

# Generate csproj file and add the dependency in the solution file
Copy-Template -SourceName Az.ModuleName.csproj -DestPath (Join-Path $DestPath $submoduleDir.Name) -DestName "Az.$submoduleName.csproj" -RootModuleName $ModuleName -ModuleName $submoduleName -ModuleFolder $submoduleDir.Name
}
Expand Down Expand Up @@ -176,6 +181,7 @@ Function Move-Generation2Master {
$psd1Data.RequiredAssemblies = $psd1Data.RequiredAssemblies | Where-Object { $_ -ne $assemblyToRemove }
Update-ModuleManifest -Path $psd1Path -RequiredAssemblies $psd1Data.RequiredAssemblies
}

Import-Module $psd1Path
Import-Module platyPS
$HelpFolder = "$DestPath\$ModuleName$Psd1FolderPostfix\help"
Expand All @@ -195,7 +201,6 @@ Function Move-Generation2Master {
Remove-Item $ExposedHelpFile.FullName
}
}
Write-Host "$ScriptRoot/../ResolveTools/Resolve-Psd1.ps1"
& "$ScriptRoot/../ResolveTools/Resolve-Psd1.ps1" -ModuleName $ModuleName -ArtifactFolder "$DestPath\..\..\artifacts" -Psd1Folder "$DestPath/$ModuleName$Psd1FolderPostfix"
}
else
Expand Down

0 comments on commit d01fa1f

Please sign in to comment.