Skip to content

Commit 050b0a3

Browse files
gfraiteurclaude
andcommitted
Fix Dockerfile path resolution in DockerBuild.ps1.
When the -Dockerfile parameter is provided with a relative path, it now resolves relative to the original current directory (where the script was invoked from) rather than relative to the script's location after Set-Location $PSScriptRoot. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 59ddd69 commit 050b0a3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/PostSharp.Engineering.BuildTools/Resources/DockerBuild.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ if ([string]::IsNullOrEmpty($BuildAgentPath))
6262
}
6363
}
6464

65+
# Resolve Dockerfile path relative to original current directory (before changing location)
66+
# This must be done before Set-Location to preserve the user's intended relative path
67+
if ($Dockerfile -and -not [System.IO.Path]::IsPathRooted($Dockerfile))
68+
{
69+
$Dockerfile = Join-Path (Get-Location).Path $Dockerfile
70+
}
71+
6572
# Save current location and restore on exit
6673
Push-Location
6774
try

0 commit comments

Comments
 (0)