Document environment variables of MacOS images (#2493)

* Document environment variables of MacOS images

* Change adnroid variables

* Apply reviews

* Remove some variables, fix headers

* Show link targets

* rename helper

* remove symlinks

* More links
This commit is contained in:
Sergey Dolin
2021-02-08 11:45:16 +05:00
committed by GitHub
parent dad0901d33
commit 6beed71b4f
5 changed files with 84 additions and 4 deletions

View File

@@ -30,3 +30,22 @@ function New-MDNewLine {
$newLineSymbol = [System.Environment]::NewLine
return $newLineSymbol * $Count
}
function Get-LinkTarget {
param (
[string] $inputPath
)
$link = Get-Item $inputPath | Select-Object -ExpandProperty Target
if ($link) {
return " -> $link"
}
return ""
}
function Get-PathWithLink {
param (
[string] $inputPath
)
$link = Get-LinkTarget($inputPath)
return "${inputPath}${link}"
}

View File

@@ -1,3 +1,5 @@
Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1" -DisableNameChecking
function Split-TableRowByColumns {
param(
[string] $Row
@@ -98,6 +100,18 @@ function Build-AndroidTable {
}
}
function Build-AndroidEnvironmentTable {
$androidVersions = Get-Item env:ANDROID_*
$shoulddResolveLink = 'ANDROID_NDK_PATH', 'ANDROID_NDK_HOME', 'ANDROID_NDK_ROOT', 'ANDROID_NDK_LATEST_HOME'
return $androidVersions | Sort-Object -Property Name | ForEach-Object {
[PSCustomObject] @{
"Name" = $_.Name
"Value" = if ($shoulddResolveLink.Contains($_.Name )) { Get-PathWithLink($_.Value) } else {$_.Value}
}
}
}
function Get-AndroidPackageVersions {
param (
[Parameter(Mandatory)]

View File

@@ -50,3 +50,25 @@ function Get-FirefoxVersion {
function Get-GeckodriverVersion {
return Run-Command "geckodriver --version" | Select-Object -First 1
}
function Build-BrowserWebdriversEnvironmentTable {
return @(
@{
"Name" = "CHROMEWEBDRIVER"
"Value" = $env:CHROMEWEBDRIVER
},
@{
"Name" = "EDGEWEBDRIVER"
"Value" = $env:EDGEWEBDRIVER
},
@{
"Name" = "GECKOWEBDRIVER"
"Value" = $env:GECKOWEBDRIVER
}
) | ForEach-Object {
[PSCustomObject] @{
"Name" = $_.Name
"Value" = $_.Value
}
}
}

View File

@@ -1,5 +1,3 @@
Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1" -DisableNameChecking
function Get-BashVersion {
$version = bash -c 'echo ${BASH_VERSION}'
return "Bash $version"
@@ -473,3 +471,21 @@ function Get-PowershellVersion {
$powershellVersion = Run-Command "powershell --version"
return $powershellVersion
}
function Build-PackageManagementEnvironmentTable {
return @(
@{
"Name" = "CONDA"
"Value" = $env:CONDA
},
@{
"Name" = "VCPKG_INSTALLATION_ROOT"
"Value" = $env:VCPKG_INSTALLATION_ROOT
}
) | ForEach-Object {
[PSCustomObject] @{
"Name" = $_.Name
"Value" = $_.Value
}
}
}

View File

@@ -86,6 +86,9 @@ if ($os.IsHigherThanMojave) {
}
$markdown += New-MDList -Style Unordered -Lines ($packageManagementList | Sort-Object)
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-PackageManagementEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
# Project Management
$markdown += New-MDHeader "Project Management" -Level 3
@@ -183,6 +186,9 @@ $markdown += New-MDList -Style Unordered -Lines ($lintersList | Sort-Object)
$markdown += New-MDHeader "Browsers" -Level 3
$markdown += Get-BrowserSection
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-BrowserWebdriversEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Java" -Level 3
$markdown += Get-JavaVersions | New-MDTable
@@ -267,6 +273,9 @@ $markdown += New-MDNewLine
$markdown += New-MDHeader "Android" -Level 3
$markdown += Build-AndroidTable | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-AndroidEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
#
# Generate systeminfo.txt with information about image (for debug purpose)