diff --git a/bin/dart b/bin/dart index d14d8adcce..bcf8a8be9a 100755 --- a/bin/dart +++ b/bin/dart @@ -43,8 +43,14 @@ function follow_links() ( echo "$file" ) -PROG_NAME="$(follow_links "$BASH_SOURCE")" +PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")" BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" +OS="$(uname -s)" + +if [[ $OS =~ MINGW.* ]]; then + # If we're on Windows, invoke the batch script instead, to get proper locking. + exec "${BIN_DIR}/dart.bat" "$@" +fi # To define `shared::execute()` function source "$BIN_DIR/internal/shared.sh" diff --git a/bin/flutter b/bin/flutter index 06ac64ab39..c2223df1ce 100755 --- a/bin/flutter +++ b/bin/flutter @@ -43,8 +43,14 @@ function follow_links() ( echo "$file" ) -PROG_NAME="$(follow_links "$BASH_SOURCE")" +PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")" BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" +OS="$(uname -s)" + +if [[ $OS =~ MINGW.* ]]; then + # If we're on Windows, invoke the batch script instead, to get proper locking. + exec "${BIN_DIR}/flutter.bat" "$@" +fi # To define `shared::execute()` function source "$BIN_DIR/internal/shared.sh" diff --git a/bin/internal/shared.sh b/bin/internal/shared.sh index 702bd9ed5b..8d613de739 100644 --- a/bin/internal/shared.sh +++ b/bin/internal/shared.sh @@ -170,7 +170,7 @@ function shared::execute() { # If running over git-bash, overrides the default UNIX executables with win32 # executables case "$(uname -s)" in - MINGW32*) + MINGW*) DART="$DART.exe" PUB="$PUB.bat" ;; diff --git a/bin/internal/update_dart_sdk.sh b/bin/internal/update_dart_sdk.sh index f45b15b9af..7a3e77d5a8 100755 --- a/bin/internal/update_dart_sdk.sh +++ b/bin/internal/update_dart_sdk.sh @@ -67,7 +67,7 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t DART_ZIP_NAME="dart-sdk-linux-x64.zip" IS_USER_EXECUTABLE="-perm /u+x" ;; - MINGW32*) + MINGW*) DART_ZIP_NAME="dart-sdk-windows-x64.zip" IS_USER_EXECUTABLE="-perm /u+x" ;;