mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-08-11 08:04:39 +07:00
Improve tools setup
Log full semver of tools installed with composer Refactor adding paths to PATH
This commit is contained in:
@ -64,10 +64,17 @@ Function Add-Path {
|
||||
param(
|
||||
[string]$PathItem
|
||||
)
|
||||
$newPath = (Get-ItemProperty -Path 'hkcu:\Environment' -Name PATH).Path.replace("$PathItem;", '')
|
||||
$newPath = $PathItem + ';' + $newPath
|
||||
Set-ItemProperty -Path 'hkcu:\Environment' -Name Path -Value $newPath
|
||||
Get-PathFromRegistry
|
||||
if(-not(Test-Path $PathItem) -or "$env:PATH;".contains("$PathItem;")) {
|
||||
return
|
||||
}
|
||||
if ($env:GITHUB_PATH) {
|
||||
Add-Content $PathItem -Path $env:GITHUB_PATH -Encoding utf8
|
||||
} else {
|
||||
$newPath = (Get-ItemProperty -Path 'hkcu:\Environment' -Name PATH).Path.replace("$PathItem;", '')
|
||||
$newPath = $PathItem + ';' + $newPath
|
||||
Set-ItemProperty -Path 'hkcu:\Environment' -Name Path -Value $newPath
|
||||
Get-PathFromRegistry
|
||||
}
|
||||
}
|
||||
|
||||
# Function to make sure printf is in PATH.
|
||||
|
Reference in New Issue
Block a user