File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,25 @@ $latestName = "latest"
33
44$LatestVersion = (Select-String - Path $Path - Pattern " latest = true" - Context 3 , 0 ) -split " `" "
55
6- # Use $LatestVersion[1] as we know that the version is the first line returned and splitting on " makes it the 2nd index
6+ # Use $LatestVersion[1] as we know that the version is the first line returned and splitting on " makes it the 2nd index
77$Version = $LatestVersion [1 ]
88
9+ # Remove latest folder and contents in docs if it already exists
910if (Test-Path " .\content\en\docs\$latestName " ){
1011 Remove-Item - LiteralPath " .\content\en\docs\$latestName " - Force - Recurse
1112}
13+ # Create new latest docs folder
1214New-Item - ItemType Directory - Path " .\content\en\docs\$latestName \" - Force
15+ # Copy contents of latest XXXX.X version into latest folder
1316Copy-Item - Path " .\content\en\docs\$Version \*" - Destination " .\content\en\docs\$latestName \" - Recurse - Force
17+ # Replace the title name for the folder to be latest
1418(Get-Content .\content\en\docs\latest\_index.md) -replace $Version , " Latest" | Set-Content .\content\en\docs\latest\_index.md
1519
20+ # Remove latest folder and contents in static if it already exists
21+ if (Test-Path " .\content\static\$latestName " ){
22+ Remove-Item - LiteralPath " .\content\static\$latestName " - Force - Recurse
23+ }
24+ # Create new latest static folder
1625New-Item - ItemType Directory - Path " .\content\static\$latestName \" - Force
26+ # Copy contents of latest XXXX.X version into latest folder
1727Copy-Item - Path " .\content\static\$Version \*" - Destination " .\content\static\$latestName \" - Recurse - Force
You can’t perform that action at this time.
0 commit comments