Skip to content

Commit

Permalink
chore: Replace deprecated env function with (Set|Get)-EnvVar (#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
brian6932 authored May 20, 2024
1 parent fada8ad commit 96c3e81
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 50 deletions.
8 changes: 4 additions & 4 deletions bucket/python-alpha.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -73,8 +73,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python-beta.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -73,8 +73,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python-pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -73,8 +73,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -73,8 +73,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python310.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object { Expand-MsiArchive $_ \"$dir\" }",
"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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -69,8 +69,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python311.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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand Down Expand Up @@ -94,8 +94,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python312.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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand Down Expand Up @@ -94,8 +94,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python35.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object { Expand-MsiArchive $_ \"$dir\" }",
"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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -69,8 +69,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python36.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object { Expand-MsiArchive $_ \"$dir\" }",
"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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -69,8 +69,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python37.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object { Expand-MsiArchive $_ \"$dir\" }",
"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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -69,8 +69,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python38.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object { Expand-MsiArchive $_ \"$dir\" }",
"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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -69,8 +69,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
8 changes: 4 additions & 4 deletions bucket/python39.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object { Expand-MsiArchive $_ \"$dir\" }",
"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) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global",
"}"
]
},
Expand All @@ -69,8 +69,8 @@
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
" $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''",
" Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global",
"}"
]
},
Expand Down
2 changes: 1 addition & 1 deletion bucket/tesseract3.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"post_install": [
"$langdir = versiondir tesseract3-languages current $global",
"if (Test-Path $langdir) {",
" env \"TESSDATA_PREFIX\" $global $langdir",
" Set-EnvVar -Name TESSDATA_PREFIX -Value $langdir -Global:$global",
"}"
]
}
2 changes: 1 addition & 1 deletion bucket/tesseract4.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"post_install": [
"$langdir = versiondir tesseract4-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 96c3e81

Please sign in to comment.