Skip to content

Commit

Permalink
Fix generated content script warnings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell committed Mar 5, 2025
1 parent da89d5c commit 5d16a9c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions eng/DependencyManagement.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ function Get-ProductReleaseState() {
return 'Prerelease'
}
}

function Get-DockerOs() {
return docker version -f "{{ .Server.Os }}"
}
4 changes: 3 additions & 1 deletion eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ if (-Not $OutputDirectory) {
$onDockerfilesGenerated = {
param($ContainerName)

if (-Not $Validate) {
# On Windows, ImageBuilder is run locally due to limitations with running Docker client within a container.
# Remove linux condition when https://github.com/dotnet/docker-tools/issues/159 is resolved
if ($(Get-DockerOs) -eq "linux" -and -not $Validate) {
Exec "docker cp ${ContainerName}:/repo/src $OutputDirectory"
}
}
Expand Down
4 changes: 3 additions & 1 deletion eng/readme-templates/Get-GeneratedReadmes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ function CopyReadme([string]$containerName, [string]$readmeRelativePath) {
$onDockerfilesGenerated = {
param($ContainerName)

if (-Not $Validate) {
# On Windows, ImageBuilder is run locally due to limitations with running Docker client within a container.
# Remove linux condition when https://github.com/dotnet/docker-tools/issues/159 is resolved.
if ($(Get-DockerOs) -eq "linux" -and -not $Validate) {
CopyReadme $ContainerName "README.aspire-dashboard.md"
CopyReadme $ContainerName "README.aspnet.md"
CopyReadme $ContainerName "README.md"
Expand Down

0 comments on commit 5d16a9c

Please sign in to comment.