diff options
author | Seungha Yang <seungha@centricular.com> | 2022-06-15 06:59:33 +0900 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-06-14 19:09:25 -0400 |
commit | ee7a7fec10298e8dabc423f6163e866d19473e7f (patch) | |
tree | a5da9b8d6f1f640691451bf9d2707c56cb49fecb | |
parent | d85a9733e6af45c9e3111f23ecec9e614eaeaeeb (diff) | |
download | meson-ee7a7fec10298e8dabc423f6163e866d19473e7f.zip meson-ee7a7fec10298e8dabc423f6163e866d19473e7f.tar.gz meson-ee7a7fec10298e8dabc423f6163e866d19473e7f.tar.bz2 |
devenv: Add support for PowerShell 7 on Windows
Checks "pwsh.exe" in addition to "powershell.exe" and "cmd.exe"
to support PowerShell 7 on Windows. The Powershell 7 support was added
in GStreamer (which is the origin of this script) already via
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2545
-rw-r--r-- | mesonbuild/mdevenv.py | 5 | ||||
-rw-r--r-- | mesonbuild/scripts/cmd_or_ps.ps1 | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/mdevenv.py b/mesonbuild/mdevenv.py index 041d22d..46b301c 100644 --- a/mesonbuild/mdevenv.py +++ b/mesonbuild/mdevenv.py @@ -185,9 +185,8 @@ def run(options: argparse.Namespace) -> int: args = [shell_env] elif is_windows(): shell = get_windows_shell() - if shell == 'powershell.exe': - args = ['powershell.exe'] - args += ['-NoLogo', '-NoExit'] + if shell in ['powershell.exe', 'pwsh.exe']: + args = [shell, '-NoLogo', '-NoExit'] prompt = f'function global:prompt {{ "{prompt_prefix} PS " + $PWD + "> "}}' args += ['-Command', prompt] else: diff --git a/mesonbuild/scripts/cmd_or_ps.ps1 b/mesonbuild/scripts/cmd_or_ps.ps1 index 884d7e0..1d677d9 100644 --- a/mesonbuild/scripts/cmd_or_ps.ps1 +++ b/mesonbuild/scripts/cmd_or_ps.ps1 @@ -5,7 +5,7 @@ $i=1 $ppid=(gwmi win32_process -Filter "processid='$pid'").parentprocessid $pname=(Get-Process -id $ppid).Name While($true) { - if($pname -eq "cmd" -Or $pname -eq "powershell") { + if($pname -eq "cmd" -Or $pname -eq "powershell" -Or $pname -eq "pwsh") { Write-Host ("{0}.exe" -f $pname) Break } |