From c885015934b223ee67b3972db7ef4b3ce0b74467 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Sun, 4 Mar 2018 12:15:22 -0800 Subject: [PATCH] Fix download Dart DK step to work for paths with apostrophes (#15137) Fixes https://github.com/flutter/flutter/issues/15136 --- bin/flutter.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/flutter.bat b/bin/flutter.bat index 66cffcf0cb..ed81a65c7a 100644 --- a/bin/flutter.bat +++ b/bin/flutter.bat @@ -88,7 +88,10 @@ GOTO :after_subroutine :do_sdk_update_and_snapshot ECHO Checking Dart SDK version... - CALL PowerShell.exe -ExecutionPolicy Bypass -Command "& '%FLUTTER_ROOT%/bin/internal/update_dart_sdk.ps1'" + SET update_dart_bin=%FLUTTER_ROOT%/bin/internal/update_dart_sdk.ps1 + REM Escape apostrophes from the executable path + SET "update_dart_bin=!update_dart_bin:'=''!" + CALL PowerShell.exe -ExecutionPolicy Bypass -Command "& '%update_dart_bin%'" IF "%ERRORLEVEL%" NEQ "0" ( ECHO Error: Unable to update Dart SDK. Retrying... timeout /t 5 /nobreak