Skip to content

Commit

Permalink
Add MSYS2 detection on Windows Terminal (#117612)
Browse files Browse the repository at this point in the history
As the results of "uname -s" command is like the below on MSYS2 on
Windows Terminal,

MSYS_NT-10.0-22621

This patch fixes the Flutter command working on this kind of systems.

Signed-off-by: Deokgyu Yang <[email protected]>

Signed-off-by: Deokgyu Yang <[email protected]>
  • Loading branch information
awesometic authored Jan 12, 2023
1 parent ace4fb5 commit db8d1a4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
OS="$(uname -s)"

# If we're on Windows, invoke the batch script instead to get proper locking.
if [[ $OS =~ MINGW.* || $OS =~ CYGWIN.* ]]; then
if [[ $OS =~ MINGW.* || $OS =~ CYGWIN.* || $OS =~ MSYS.* ]]; then
exec "${BIN_DIR}/dart.bat" "$@"
fi

Expand Down
2 changes: 1 addition & 1 deletion bin/flutter
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
OS="$(uname -s)"

# If we're on Windows, invoke the batch script instead to get proper locking.
if [[ $OS =~ MINGW.* || $OS =~ CYGWIN.* ]]; then
if [[ $OS =~ MINGW.* || $OS =~ CYGWIN.* || $OS =~ MSYS.* ]]; then
exec "${BIN_DIR}/flutter.bat" "$@"
fi

Expand Down
2 changes: 1 addition & 1 deletion bin/internal/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function shared::execute() {
# If running over git-bash, overrides the default UNIX executables with win32
# executables
case "$(uname -s)" in
MINGW*)
MINGW* | MSYS* )
DART="$DART.exe"
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion bin/internal/update_dart_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
DART_ZIP_NAME="dart-sdk-linux-${ARCH}.zip"
IS_USER_EXECUTABLE="-perm /u+x"
;;
MINGW*)
MINGW* | MSYS* )
DART_ZIP_NAME="dart-sdk-windows-x64.zip"
IS_USER_EXECUTABLE="-perm /u+x"
;;
Expand Down

0 comments on commit db8d1a4

Please sign in to comment.