Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59c4998

Browse files
committed
further simplify WinPython_PS_Prompt.ps1
1 parent 188d964 commit 59c4998

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

winpython/portable/launchers_final/scripts/WinPython_PS_Prompt.ps1

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,9 @@ foreach ($tmp_pair in ($tmp_output -split '&&')) {
2525
# Unquote a quoted value (single or double quotes)
2626
if ($tmp_value -match '^(["''])(.*)\1$') { $tmp_value = $Matches[2] }
2727

28-
# Set as a PowerShell global variable
29-
if ($tmp_name -ne "HOME") { Set-Variable -Name $tmp_name -Value $tmp_value }
30-
Set-Variable -Name $tmp_name -Value $tmp_value -Scope Global -Force
31-
# set as environment variable for child processes
28+
# set as environment variable for child processes like python
3229
Set-Item -Path "Env:\$tmp_name" -Value $tmp_value
33-
# Write-Host $tmp_name " = " $tmp_value
34-
35-
# If running in GH Actions, also append to GITHUB_ENV so future steps see it
36-
if ($env:GITHUB_ENV) {
37-
# Use Add-Content to append "NAME=value" to the GITHUB_ENV file
38-
# Escape any newlines in $tmp_value to avoid breaking the file format
39-
$tmp_escapedValue = $tmp_value -replace "`n", '%0A' -replace "`r", ''
40-
Add-Content -Path $env:GITHUB_ENV -Value "$tmp_name=$tmp_escapedValue"
41-
}
42-
43-
#Write-Host "Set `$${name} = $tmp_value"
30+
#Write-Host $tmp_name " = " $tmp_value
4431
}
4532

4633
# emulate %__CD%

0 commit comments

Comments
 (0)