Skip to content

Commit 9a6f9eb

Browse files
Copilotraych1
authored andcommitted
Keep original workingDirectory and use Push-Location for directory switching
Co-authored-by: raych1 <[email protected]>
1 parent 05980c1 commit 9a6f9eb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,22 @@ extends:
268268
269269
if (Test-Path -Path '$(buildArtifactsPath)/packages/overrides.json') {
270270
Write-Host "Using overrides.json to generate emitter-package.json"
271+
Push-Location $(Build.SourcesDirectory)/eng/common/tsp-client
271272
npm exec --no -- tsp-client generate-config-files `
272273
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
273-
--emitter-package-json-path '$(Build.SourcesDirectory)/${{ parameters.EmitterPackageJsonOutputPath }}' `
274+
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}' `
274275
--overrides '$(buildArtifactsPath)/packages/overrides.json'
276+
Pop-Location
275277
} else {
276278
Write-Host "No overrides.json found. Running tsp-client without overrides."
279+
Push-Location $(Build.SourcesDirectory)/eng/common/tsp-client
277280
npm exec --no -- tsp-client generate-config-files `
278281
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
279-
--emitter-package-json-path '$(Build.SourcesDirectory)/${{ parameters.EmitterPackageJsonOutputPath }}'
282+
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}'
283+
Pop-Location
280284
}
281285
displayName: Generate emitter-package.json and emitter-package-lock files
282-
workingDirectory: $(Build.SourcesDirectory)/eng/common/tsp-client
286+
workingDirectory: $(Build.SourcesDirectory)
283287
284288
- ${{ parameters.InitializationSteps }}
285289

0 commit comments

Comments
 (0)