Skip to content

Commit ada31ee

Browse files
Copilotraych1
authored andcommitted
Resolve EmitterPackageJsonOutputPath to absolute path if relative
Co-authored-by: raych1 <[email protected]>
1 parent 9a6f9eb commit ada31ee

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,20 +266,27 @@ extends:
266266
- pwsh: |
267267
Write-Host "Overrides location: $(buildArtifactsPath)/packages/overrides.json"
268268
269+
# Resolve EmitterPackageJsonOutputPath to absolute path if it's relative
270+
$emitterPath = '${{ parameters.EmitterPackageJsonOutputPath }}'
271+
if (-not [System.IO.Path]::IsPathRooted($emitterPath)) {
272+
$emitterPath = Join-Path '$(Build.SourcesDirectory)' $emitterPath
273+
}
274+
Write-Host "Resolved emitter package path: $emitterPath"
275+
269276
if (Test-Path -Path '$(buildArtifactsPath)/packages/overrides.json') {
270277
Write-Host "Using overrides.json to generate emitter-package.json"
271278
Push-Location $(Build.SourcesDirectory)/eng/common/tsp-client
272279
npm exec --no -- tsp-client generate-config-files `
273280
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
274-
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}' `
281+
--emitter-package-json-path "$emitterPath" `
275282
--overrides '$(buildArtifactsPath)/packages/overrides.json'
276283
Pop-Location
277284
} else {
278285
Write-Host "No overrides.json found. Running tsp-client without overrides."
279286
Push-Location $(Build.SourcesDirectory)/eng/common/tsp-client
280287
npm exec --no -- tsp-client generate-config-files `
281288
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
282-
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}'
289+
--emitter-package-json-path "$emitterPath"
283290
Pop-Location
284291
}
285292
displayName: Generate emitter-package.json and emitter-package-lock files

0 commit comments

Comments
 (0)