Skip to content

Commit c087fb3

Browse files
windows: allow pwsh.bat wrapper (flutter#171778)
After git clone flutter/flutter, flutter commands require the use of powershell to run ps1 scripts. On my corporate workstation, I need to use a pwsh.bat wrapper to run ps1 scripts. This PR uses `pwsh` instead of `pwsh.exe` to find and use a bat wrapper from the path if present. Closes flutter#171777. ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing.
1 parent 500684c commit c087fb3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bin/dart.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ FOR %%i IN ("%~dp0..") DO SET FLUTTER_ROOT=%%~fi
1818
REM Detect which PowerShell executable is available on the host
1919
REM PowerShell version <= 5: PowerShell.exe
2020
REM PowerShell version >= 6: pwsh.exe
21-
WHERE /Q pwsh.exe && (
22-
SET powershell_executable=pwsh.exe
21+
WHERE /Q pwsh && (
22+
SET "powershell_executable=call pwsh"
2323
) || WHERE /Q PowerShell.exe && (
2424
SET powershell_executable=PowerShell.exe
2525
) || (

bin/flutter-dev.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ IF "%ERRORLEVEL%" NEQ "0" (
3737
REM Detect which PowerShell executable is available on the host
3838
REM PowerShell version <= 5: PowerShell.exe
3939
REM PowerShell version >= 6: pwsh.exe
40-
WHERE /Q pwsh.exe && (
41-
SET powershell_executable=pwsh.exe
40+
WHERE /Q pwsh && (
41+
SET "powershell_executable=call pwsh"
4242
) || WHERE /Q PowerShell.exe && (
4343
SET powershell_executable=PowerShell.exe
4444
) || (

bin/flutter.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ IF "%ERRORLEVEL%" NEQ "0" (
3232
REM Detect which PowerShell executable is available on the host
3333
REM PowerShell version <= 5: PowerShell.exe
3434
REM PowerShell version >= 6: pwsh.exe
35-
WHERE /Q pwsh.exe && (
36-
SET powershell_executable=pwsh.exe
35+
WHERE /Q pwsh && (
36+
SET "powershell_executable=call pwsh"
3737
) || WHERE /Q PowerShell.exe && (
3838
SET powershell_executable=PowerShell.exe
3939
) || (

0 commit comments

Comments
 (0)