Skip to content

Commit c5b3e88

Browse files
committed
limit delete operation to the main directory
1 parent ef27250 commit c5b3e88

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.azure-pipelines/generate-v1.0-models.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ steps:
5757
Write-Host "Path to clean metadata $cleanMetadata"
5858
Write-Host "##vso[task.setvariable variable=cleanMetadata]$cleanMetadata"
5959
60-
$branchName = "zengin/namespacesJava" # Match the spec in the GH Action
60+
$branchName = "zengin/namespacesJava2" # Match the spec in the GH Action
6161
Write-Host "Branch path spec for the pull request will be $branchName"
6262
Write-Host "##vso[task.setvariable variable=branchName]$branchName"
6363
@@ -84,15 +84,16 @@ steps:
8484
inputs:
8585
targetType: inline
8686
script: |
87-
$extensionsAndGeneratedDirectories = Get-ChildItem $repoDir -Include extensions,generated -Recurse -Directory
87+
$mainDir = Join-Path $repoDir "\src\main\"
88+
$extensionsAndGeneratedDirectories = Get-ChildItem $mainDir -Include extensions,generated -Recurse -Directory
8889
8990
# this list should be updated if a new hand-crafted extension is added to one of the extensions/ directories
9091
$filesThatShouldNotBeDeleted = "UploadSession.java","DateOnly.java","TimeOfDay.java","Multipart.java","ChunkedUploadRequest.java","ChunkedUploadResult.java","CustomRequestBuilder.java"
9192
foreach ($directory in $extensionsAndGeneratedDirectories)
9293
{
9394
Remove-Item $directory.FullName -Recurse -Force -Exclude $filesThatShouldNotBeDeleted
9495
}
95-
Write-Host "Removed the existing generated files in the repo: $repoDir" -ForegroundColor Green
96+
Write-Host "Removed the existing generated files in the repo's main directory: $mainDir" -ForegroundColor Green
9697
enabled: true # The old GUI pipeline wasn't doing this. I recall that there was a reason
9798
# for this but I can't recall the reason but I think it was related to reducing number of
9899
# generated files.

0 commit comments

Comments
 (0)