Skip to content

Commit 632e82e

Browse files
Copilotraych1
authored andcommitted
Use absolute path and remove try/finally blocks
Co-authored-by: raych1 <[email protected]>
1 parent d846de9 commit 632e82e

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

eng/common/pipelines/templates/archetype-typespec-emitter.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -259,41 +259,27 @@ extends:
259259
displayName: Download pipeline artifacts
260260

261261
- pwsh: |
262-
Push-Location eng/common/tsp-client
263-
try {
264-
npm ci
265-
} finally {
266-
Pop-Location
267-
}
262+
npm ci
268263
displayName: Install tsp-client
264+
workingDirectory: $(Build.SourcesDirectory)/eng/common/tsp-client
269265
270266
- pwsh: |
271267
Write-Host "Overrides location: $(buildArtifactsPath)/packages/overrides.json"
272268
273269
if (Test-Path -Path '$(buildArtifactsPath)/packages/overrides.json') {
274270
Write-Host "Using overrides.json to generate emitter-package.json"
275-
Push-Location eng/common/tsp-client
276-
try {
277-
npm exec --no -- tsp-client generate-config-files `
271+
npm exec --no -- tsp-client generate-config-files `
278272
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
279273
--emitter-package-json-path '$(Build.SourcesDirectory)/${{ parameters.EmitterPackageJsonOutputPath }}' `
280274
--overrides '$(buildArtifactsPath)/packages/overrides.json'
281-
} finally {
282-
Pop-Location
283-
}
284275
} else {
285276
Write-Host "No overrides.json found. Running tsp-client without overrides."
286-
Push-Location eng/common/tsp-client
287-
try {
288-
npm exec --no -- tsp-client generate-config-files `
277+
npm exec --no -- tsp-client generate-config-files `
289278
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
290279
--emitter-package-json-path '$(Build.SourcesDirectory)/${{ parameters.EmitterPackageJsonOutputPath }}'
291-
} finally {
292-
Pop-Location
293-
}
294280
}
295281
displayName: Generate emitter-package.json and emitter-package-lock files
296-
workingDirectory: $(Build.SourcesDirectory)
282+
workingDirectory: $(Build.SourcesDirectory)/eng/common/tsp-client
297283
298284
- ${{ parameters.InitializationSteps }}
299285

0 commit comments

Comments
 (0)