From 9a9a185b1a4306acb6dd3e8ba96d0286a302ccf5 Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:43:42 +0200 Subject: [PATCH] [macOS] add node to software report macOS 13 arm64 (#8603) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”> --- .../SoftwareReport.Generator.ps1 | 10 ++++----- .../SoftwareReport.Toolcache.psm1 | 22 ++++++++++++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index 160565588fde..4f19089a5cd2 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -44,9 +44,9 @@ if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) { $languageAndRuntime.AddToolVersion("Go", $(Get-GoVersion)) } $languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion)) +$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion)) if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) { $languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion)) - $languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion)) $languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion)) $languageAndRuntime.AddToolVersionsListInline("NVM - Cached node versions", $(Get-NVMNodeVersionList), '^\d+') } @@ -211,11 +211,9 @@ $browsers.AddNode($(Build-BrowserWebdriversEnvironmentTable)) $java = $installedSoftware.AddHeader("Java") $java.AddTable($(Get-JavaVersions)) -if (-not $os.IsVenturaArm64) { - # Toolcache - $toolcache = $installedSoftware.AddHeader("Cached Tools") - $toolcache.AddNodes($(Build-ToolcacheSection)) -} +# Toolcache +$toolcache = $installedSoftware.AddHeader("Cached Tools") +$toolcache.AddNodes($(Build-ToolcacheSection)) # Rust $rust = $installedSoftware.AddHeader("Rust Tools") diff --git a/images/macos/software-report/SoftwareReport.Toolcache.psm1 b/images/macos/software-report/SoftwareReport.Toolcache.psm1 index a7296b203e2f..0878024cbf4d 100644 --- a/images/macos/software-report/SoftwareReport.Toolcache.psm1 +++ b/images/macos/software-report/SoftwareReport.Toolcache.psm1 @@ -33,14 +33,24 @@ function Get-ToolcacheGoVersions { return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ } } -function Build-ToolcacheSection { - return @( - [ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List"), - [ToolVersionsListNode]::new("Python", $(Get-ToolcachePythonVersions), '^\d+\.\d+', "List"), - [ToolVersionsListNode]::new("PyPy", $(Get-ToolcachePyPyVersions), '^\d+\.\d+', "List"), +function Build-ToolcacheSection { + + $nodes = @() + + if (-not $os.IsVenturaArm64) { + $nodes += @( + [ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List"), + [ToolVersionsListNode]::new("PyPy", $(Get-ToolcachePyPyVersions), '^\d+\.\d+', "List") + ) + } + + $nodes += @( + [ToolVersionsListNode]::new("Python", $(Get-ToolcachePythonVersions), '^\d+\.\d+', "List"), [ToolVersionsListNode]::new("Node.js", $(Get-ToolcacheNodeVersions), '^\d+', "List"), [ToolVersionsListNode]::new("Go", $(Get-ToolcacheGoVersions), '^\d+\.\d+', "List") ) + + return $nodes } function Get-PowerShellModules { @@ -50,4 +60,4 @@ function Get-PowerShellModules { $moduleVersions = Get-Module -Name $moduleName -ListAvailable | Select-Object -ExpandProperty Version | Sort-Object -Unique return [ToolVersionsListNode]::new($moduleName, $moduleVersions, '^\d+', "Inline") } -} \ No newline at end of file +}