Skip to content

Commit 14adf6d

Browse files
Fix to run build-extensions.ps1 script locally and remotely (#6703)
* fix to run locally and remotely * address PR comments
1 parent 2d6d9a0 commit 14adf6d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

build/build-extensions.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ param (
55
[string]$commitHash = "N/A"
66
)
77

8-
$currentDir = Split-Path -Parent $MyInvocation.MyCommand.Path
9-
$rootDir = Split-Path -Parent $currentDir
8+
$rootDir = Split-Path -Parent $PSScriptRoot
109
$buildOutput = Join-Path $rootDir "buildoutput"
1110
$hasSuffix = ![string]::IsNullOrEmpty($suffix)
1211

@@ -52,7 +51,13 @@ function BuildRuntime([string] $targetRid, [bool] $isSelfContained) {
5251
$suffixCmd = "/p:VersionSuffix=$suffix"
5352
}
5453

55-
$cmd = "publish", ".\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj", "-r", "$targetRid", "--self-contained", "$isSelfContained", "/p:PublishReadyToRun=true", "/p:PublishReadyToRunEmitSymbols=true", "-o", "$publishTarget", "-v", "m", "/p:BuildNumber=$buildNumber", "/p:IsPackable=false", "/p:CommitHash=$commitHash", "-c", "Release", $suffixCmd
54+
$projectPath = "$PSScriptRoot\..\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj"
55+
if (-not (Test-Path $projectPath))
56+
{
57+
throw "Project path '$projectPath' does not exist."
58+
}
59+
60+
$cmd = "publish", "$PSScriptRoot\..\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj", "-r", "$targetRid", "--self-contained", "$isSelfContained", "/p:PublishReadyToRun=true", "/p:PublishReadyToRunEmitSymbols=true", "-o", "$publishTarget", "-v", "m", "/p:BuildNumber=$buildNumber", "/p:IsPackable=false", "/p:CommitHash=$commitHash", "-c", "Release", $suffixCmd
5661

5762
Write-Host "======================================"
5863
Write-Host "Building $targetRid"

0 commit comments

Comments
 (0)