mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-12 12:56:47 +00:00
* Create ubuntu-report.yml * Update ubuntu-report.yml * Update ubuntu-report.yml * Update Common.Helpers.psm1 * Update ubuntu-report.yml * Update ubuntu-report.yml * Update SoftwareReport.Generator.ps1 * Update ubuntu-report.yml * Update ubuntu-report.yml * env vars * Implement language and runtime * Add package management section * fix typo * fix typo * add projectManagement and tools * fix some tools * add CLI tools, Java, PHP Tools, Haskell Tools, Rust Tools, Browsers, .NET Core * fix typo * more changes * fix typo * fix typo * fix typo * change templates * fix toolset * Update Ubuntu2004 and 2204 templates * fix cargo * fix tiny nitpicks * Fix AddToolVersionsList * Remove unused methods * Fix contructor
42 lines
1019 B
PowerShell
42 lines
1019 B
PowerShell
function Take-OutputPart {
|
|
param (
|
|
[Parameter(ValueFromPipeline)]
|
|
[string] $toolOutput,
|
|
[string] $Delimiter = " ",
|
|
[int[]] $Part
|
|
)
|
|
$parts = $toolOutput.Split($Delimiter, [System.StringSplitOptions]::RemoveEmptyEntries)
|
|
$selectedParts = $parts[$Part]
|
|
return [string]::Join($Delimiter, $selectedParts)
|
|
}
|
|
|
|
function Restore-UserOwner {
|
|
sudo chown -R ${env:USER}: $env:HOME
|
|
}
|
|
|
|
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}"
|
|
}
|
|
|
|
function Get-AptSourceRepository {
|
|
param([String] $PackageName)
|
|
|
|
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part (1..3)
|
|
return $sourceUrl
|
|
}
|