Merge branch 'main' into pipx-windows

This commit is contained in:
Maxim Lobanov
2020-11-05 10:50:57 +03:00
committed by GitHub
30 changed files with 908 additions and 67 deletions

View File

@@ -3,8 +3,8 @@ $shellPath = "C:\shells"
New-Item -Path $shellPath -ItemType Directory | Out-Null
# sh and bash <--> C:\msys64\usr\bin\bash.exe
New-Item -ItemType SymbolicLink -Path "$shellPath\bash.exe" -Target "C:\msys64\usr\bin\bash.exe" | Out-Null
New-Item -ItemType SymbolicLink -Path "$shellPath\sh.exe" -Target "C:\msys64\usr\bin\sh.exe" | Out-Null
New-Item -ItemType SymbolicLink -Path "$shellPath\bash.exe" -Target "C:\msys64\bin\bash.exe" | Out-Null
New-Item -ItemType SymbolicLink -Path "$shellPath\sh.exe" -Target "C:\msys64\bin\sh.exe" | Out-Null
# WSL is available on Windows Server 2019
if (Test-IsWin19)

View File

@@ -33,4 +33,8 @@ Remove-Item $profile.AllUsersAllHosts -Force
# Clean yarn and npm cache
yarn cache clean
npm cache clean --force
npm cache clean --force
# allow msi to write to temp folder
# see https://github.com/actions/virtual-environments/issues/1704
icacls "C:\Windows\Temp" /q /c /t /grant Users:F /T

View File

@@ -95,4 +95,10 @@ if (Test-Path "C:\Program Files\Git\etc\ssh")
ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
}
# Copy bash wrapper from git
$wrapperPath = "C:\msys64\bin"
New-Item -Path $wrapperPath -ItemType Directory -Force | Out-Null
Copy-Item -Path "$env:ProgramFiles\Git\bin\bash.exe" -Destination $wrapperPath
Copy-Item -Path "$env:ProgramFiles\Git\bin\sh.exe" -Destination $wrapperPath
Invoke-PesterTests -TestFile "MSYS2"

View File

@@ -262,6 +262,17 @@ function Get-CachedDockerImages {
return (docker images --digests --format "* {{.Repository}}:{{.Tag}}").Split("*") | Where-Object { $_ }
}
function Get-CachedDockerImagesTableData {
return (docker images --digests --format "*{{.Repository}}:{{.Tag}}|{{.Digest}} |{{.CreatedAt}}").Split("*") | Where-Object { $_ } | ForEach-Object {
$parts=$_.Split("|")
[PSCustomObject] @{
"Repository:Tag" = $parts[0]
"Digest" = $parts[1]
"Created" = $parts[2].split(' ')[0]
}
}
}
function Get-PacmanVersion {
$msys2BinDir = "C:\msys64\usr\bin"
$pacmanPath = Join-Path $msys2BinDir "pacman.exe"
@@ -285,4 +296,4 @@ function Get-YAMLLintVersion {
function Get-PipxVersion {
$pipxVersion = pipx --version
return "Pipx $pipxVersion"
}
}

View File

@@ -244,6 +244,7 @@ $markdown += New-MDNewLine
# Docker images section
$markdown += New-MDHeader "Cached Docker images" -Level 3
$markdown += New-MDList -Style Unordered -Lines @(Get-CachedDockerImages)
$markdown += Get-CachedDockerImagesTableData | New-MDTable
$markdown += New-MDNewLine
$markdown | Out-File -FilePath "C:\InstalledSoftware.md"
$markdown | Out-File -FilePath "C:\InstalledSoftware.md"

View File

@@ -1,7 +1,7 @@
Describe "Shell" {
$shellTestCases = @(
@{Name = "C:\shells\bash.exe"; Target = "C:\msys64\usr\bin\bash.exe"},
@{Name = "C:\shells\sh.exe"; Target = "C:\msys64\usr\bin\sh.exe"},
@{Name = "C:\shells\bash.exe"; Target = "C:\msys64\bin\bash.exe"},
@{Name = "C:\shells\sh.exe"; Target = "C:\msys64\bin\sh.exe"},
@{Name = "C:\shells\gitbash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"},
@{Name = "C:\shells\msysbash.exe"; Target = "C:\msys64\usr\bin\bash.exe"}
)