Skip to content

Commit

Permalink
chore: Replace deprecated env function with (Set|Get)-EnvVar (#5849)
Browse files Browse the repository at this point in the history
  • Loading branch information
brian6932 committed May 20, 2024
1 parent 5f47f94 commit 36288e1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bucket/gradle-bin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"hash": "544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d",
"extract_dir": "gradle-8.7",
"post_install": [
"$current_env = env GRADLE_USER_HOME $global",
"$current_env = Get-EnvVar -Name GRADLE_USER_HOME -Global:$global",
"If ($null -eq $current_env) {",
" $path = \"$dir\\.gradle\"",
" env GRADLE_USER_HOME $global $path",
" Set-EnvVar -Name GRADLE_USER_HOME -Value $path -Global:$global",
" $Env:GRADLE_USER_HOME = $path",
" Write-Host \"Environment variable 'GRADLE_USER_HOME' set to '$path'\"",
"}"
Expand Down
4 changes: 2 additions & 2 deletions bucket/gradle.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"hash": "194717442575a6f96e1c1befa2c30e9a4fc90f701d7aee33eb879b79e7ff05c0",
"extract_dir": "gradle-8.7",
"post_install": [
"$current_env = env GRADLE_USER_HOME $global",
"$current_env = Get-EnvVar -Name GRADLE_USER_HOME -Global:$global",
"If ($null -eq $current_env) {",
" $path = \"$dir\\.gradle\"",
" env GRADLE_USER_HOME $global $path",
" Set-EnvVar -Name GRADLE_USER_HOME -Value $path -Global:$global",
" $Env:GRADLE_USER_HOME = $path",
" Write-Host \"Environment variable 'GRADLE_USER_HOME' set to '$path'\"",
"}"
Expand Down
8 changes: 4 additions & 4 deletions bucket/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"}",
"Remove-Item \"$dir\\_tmp\", \"$dir\\setup.exe\" -Force -Recurse",
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext;.PY;.PYW\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global:$true) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global:$true",
"}"
]
},
Expand All @@ -67,8 +67,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global:$true) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global:$true",
"}"
]
},
Expand Down
2 changes: 1 addition & 1 deletion bucket/tesseract.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"post_install": [
"$langdir = versiondir tesseract-languages current $global",
"if (Test-Path $langdir) {",
" env \"TESSDATA_PREFIX\" $global $langdir",
" Set-EnvVar -Name TESSDATA_PREFIX -Value $langdir -Global:$global",
"}"
],
"env_set": {
Expand Down

0 comments on commit 36288e1

Please sign in to comment.