From 5ce672b79bcea9bfa668921c38b2cad589c4435b Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Wed, 30 May 2018 08:14:48 +0100 Subject: [PATCH] Detect permissions issues running flutter on Windows (#17975) * Detect permissions issues running flutter on Windows Fixes #17972. --- bin/flutter.bat | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/flutter.bat b/bin/flutter.bat index 0c8c7c066e..4a2ba0c5de 100644 --- a/bin/flutter.bat +++ b/bin/flutter.bat @@ -47,6 +47,18 @@ IF NOT EXIST "%flutter_root%\.git" ( REM Ensure that bin/cache exists. IF NOT EXIST "%cache_dir%" MKDIR "%cache_dir%" +REM If the cache still doesn't exist, fail with an error that we probably don't have permissions. +IF NOT EXIST "%cache_dir%" ( + ECHO Error: Unable to create cache directory at + ECHO %cache_dir% + ECHO. + ECHO This may be because flutter doesn't have write permissions for + ECHO this path. Try moving the flutter directory to a writable location, + ECHO such as within your home directory. + EXIT /B 1 +) + + REM To debug the tool, you can uncomment the following lines to enable checked mode and set an observatory port: REM SET FLUTTER_TOOL_ARGS="--checked %FLUTTER_TOOL_ARGS%" REM SET FLUTTER_TOOL_ARGS="%FLUTTER_TOOL_ARGS% --observe=65432"