From e98516d815d857faa90fbcd360e4316fbec40cff Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 23 May 2024 12:13:03 -0700 Subject: [PATCH] Fix path for script invocation --- .pipelines/templates/SetVersionVariables.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.pipelines/templates/SetVersionVariables.yml b/.pipelines/templates/SetVersionVariables.yml index 6719abf6da..dbd8eb0a73 100644 --- a/.pipelines/templates/SetVersionVariables.yml +++ b/.pipelines/templates/SetVersionVariables.yml @@ -47,7 +47,22 @@ steps: - powershell: | $createJson = ("${{ parameters.CreateJson }}" -ne "no") - $releaseTag = & "$env:REPOROOT/tools/releaseBuild/setReleaseTag.ps1" -ReleaseTag ${{ parameters.ReleaseTagVar }} -Variable "${{ parameters.ReleaseTagVarName }}" -CreateJson:$createJson + + $scriptPath = if (-not (Test-Path -Path "$env:REPOROOT/tools/releaseBuild/setReleaseTag.ps1")) { + Write-Error "setReleaseTag.ps1 not found at $env:REPOROOT/tools/releaseBuild/setReleaseTag.ps1" + + if (-not (Test-Path -Path "$env:REPOROOT/PowerShell/tools/releaseBuild")) { + Write-Error "releaseBuild folder not found at $env:REPOROOT/PowerShell/tools/releaseBuild" + } + else { + "$env:REPOROOT/PowerShell/tools/releaseBuild" + } + } + else { + "$env:REPOROOT/tools/releaseBuild" + } + + $releaseTag = & $scriptPath -ReleaseTag ${{ parameters.ReleaseTagVar }} -Variable "${{ parameters.ReleaseTagVarName }}" -CreateJson:$createJson $version = $releaseTag.Substring(1) $vstsCommandString = "vso[task.setvariable variable=Version]$version" Write-Host ("sending " + $vstsCommandString)