Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions eng/scripts/Invoke-GenerateAndBuildV2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,20 @@ if ($relatedTypeSpecProjectFolder) {

# Install tsp-client dependencies from eng/common/tsp-client
$tspClientDir = Resolve-Path (Join-Path $PSScriptRoot "../common/tsp-client")
Push-Location $tspClientDir
try {
Write-Host "Installing tsp-client dependencies from $tspClientDir"
npm ci
if ($LASTEXITCODE) {
Write-Error "Failed to install tsp-client dependencies"
exit $LASTEXITCODE
}

# Use tsp-client from pinned version by running from tsp-client directory
$tspclientCommand = "npm exec --no -- tsp-client init --update-if-exists --tsp-config $tspConfigFile --repo $repo --commit $commitid"
if ($swaggerDir) {
$tspclientCommand += " --local-spec-repo $typespecFolder"
}
Write-Host $tspclientCommand
Invoke-Expression $tspclientCommand
Write-Host "Installing tsp-client dependencies from $tspClientDir"
npm ci --prefix $tspClientDir
if ($LASTEXITCODE) {
Write-Error "Failed to install tsp-client dependencies"
exit $LASTEXITCODE
}
finally {
Pop-Location

# Use tsp-client from pinned version by passing --prefix to use tsp-client from that directory
$tspclientCommand = "npm exec --prefix $tspClientDir --no -- tsp-client init --update-if-exists --tsp-config $tspConfigFile --repo $repo --commit $commitid"
if ($swaggerDir) {
$tspclientCommand += " --local-spec-repo $typespecFolder"
}
Write-Host $tspclientCommand
Invoke-Expression $tspclientCommand

if ($LASTEXITCODE) {
# If Process script call fails, then return with failure to CI and don't need to call GeneratePackage
Expand Down
Loading