Fix paths for bin tools and scoped tools [skip ci]

This commit is contained in:
Shivam Mathur
2026-01-23 01:04:38 +05:30
parent 341bc9e176
commit 1eee54fe48
3 changed files with 17 additions and 7 deletions

View File

@@ -81,9 +81,10 @@ Function Get-PathFromRegistry {
# Function to add a location to PATH.
Function Add-Path {
param(
[string]$PathItem
[string]$PathItem,
[switch]$Force
)
if("$env:PATH;".contains("$PathItem;")) {
if(-not($Force) -and "$env:PATH;".contains("$PathItem;")) {
return
}
if ($env:GITHUB_PATH) {
@@ -375,6 +376,7 @@ if(-not($env:ImageOS) -and -not($env:ImageVersion)) {
if(-not(Test-Path -LiteralPath $current_profile)) {
New-Item -Path $current_profile -ItemType "file" -Force >$null 2>&1
}
Add-Path -PathItem $bin_dir -Force
}
$src = Join-Path -Path $PSScriptRoot -ChildPath \..