mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 03:27:05 +00:00
[macos] Add path variables to packer templates (#9155)
* Update macos-12.pkr.hcl template * Update remaining macos templates * Update Get-ToolsetContent and get_toolset_value functions * Fix ~ symbol expansion issues * Fix bad path in macOS-14.arm64.anka.pkr.hcl
This commit is contained in:
committed by
GitHub
parent
2a7ca2e6a2
commit
ba2e955e0b
@@ -40,9 +40,17 @@ function Get-OSVersion {
|
||||
}
|
||||
}
|
||||
|
||||
# Get the value of the toolset
|
||||
function Get-ToolsetContent {
|
||||
$toolsetPath = Join-Path $env:HOME "image-generation" "toolset.json"
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the content of the toolset.json file.
|
||||
|
||||
.DESCRIPTION
|
||||
This function reads the toolset.json in path provided by IMAGE_FOLDER
|
||||
environment variable and returns the content as a PowerShell object.
|
||||
#>
|
||||
|
||||
$toolsetPath = Join-Path $env:IMAGE_FOLDER "toolset.json"
|
||||
$toolsetJson = Get-Content -Path $toolsetPath -Raw
|
||||
ConvertFrom-Json -InputObject $toolsetJson
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ is_Veertu() {
|
||||
}
|
||||
|
||||
get_toolset_value() {
|
||||
local toolset_path=$(echo "$HOME/image-generation/toolset.json")
|
||||
local toolset_path=$(echo "$IMAGE_FOLDER/toolset.json")
|
||||
local query=$1
|
||||
echo "$(jq -r "$query" $toolset_path)"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user