Skip to content

Commit d0981d0

Browse files
committed
a .ps1 launcher....
1 parent 59c4998 commit d0981d0

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

winpython/portable/launchers_final/scripts/WinPython_PS_Prompt.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# $env:PYTHONIOENCODING = "utf-8"
44

55
$tmp_dp0 = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition)
6-
$tmp_output = & ([System.IO.Path]::Combine( $tmp_dp0 , "..", "python" , "python.exe")) ([System.IO.Path]::Combine($tmp_dp0 , "WinPythonIni.py"))
6+
$tmp_output = & ([System.IO.Path]::Combine( $tmp_dp0 , "..", "python" , "python.exe")) ([System.IO.Path]::Combine($tmp_dp0 , "WinPythonIni.py")) $args
77

88
foreach ($tmp_pair in ($tmp_output -split '&&')) {
99
$tmp_pair = $tmp_pair.Trim()
@@ -31,9 +31,10 @@ foreach ($tmp_pair in ($tmp_output -split '&&')) {
3131
}
3232

3333
# emulate %__CD%
34-
$tmp_envCD = $env:__CD__
35-
if (($tmp_dp0 -eq $tmp_envCD ) -or ($tmp_dp0 -eq { Join-Path $tmp_envCD 'scripts' } )) {
36-
Set-Location -LiteralPath $WINPYWORKDIR1
34+
$tmp_envCD = $env:__CD__.TrimEnd('\')
35+
$tmp_envCDscript = ( Join-Path $tmp_envCD 'scripts' )
36+
if (($tmp_dp0 -eq $tmp_envCD ) -or ($tmp_dp0 -eq ( Join-Path $tmp_envCD 'scripts' ) )) {
37+
Set-Location -LiteralPath $env:WINPYWORKDIR1
3738
}
3839

3940
# Clean-up NameSpace
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# The '.' so variables stay in this session
2+
. (Join-Path ([System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition)) "WinPython_PS_Prompt.ps1") $Args
3+
$flatArgs = @("-m", "idlelib") + ($args | ForEach-Object { "`"$_`"" })
4+
5+
#& (Join-Path $env:WINPYDIR "python.exe") $flatArgs
6+
Start-Process -FilePath (Join-Path $env:WINPYDIR "pythonw.exe") -ArgumentList $flatArgs -WindowStyle Hidden

0 commit comments

Comments
 (0)