Unverified Commit cb1c7a36 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Ensure that Dart SDK dirs have appropriate permissions (#26315)

This is a partial re-application of #24669

https://github.com/flutter/flutter/issues/24413
parent 262f12b4
......@@ -44,9 +44,11 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
case "$(uname -s)" in
Darwin)
DART_ZIP_NAME="dart-sdk-darwin-x64.zip"
IS_USER_EXECUTABLE="-perm +100"
;;
Linux)
DART_ZIP_NAME="dart-sdk-linux-x64.zip"
IS_USER_EXECUTABLE="-perm /u+x"
;;
*)
echo "Unknown operating system. Cannot install Dart SDK."
......@@ -65,7 +67,7 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
# install the new sdk
rm -rf -- "$DART_SDK_PATH"
mkdir -p -- "$DART_SDK_PATH"
mkdir -m 755 -p -- "$DART_SDK_PATH"
DART_SDK_ZIP="$FLUTTER_ROOT/bin/cache/$DART_ZIP_NAME"
curl --continue-at - --location --output "$DART_SDK_ZIP" "$DART_SDK_URL" 2>&1 || {
......@@ -87,6 +89,8 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
exit 1
}
rm -f -- "$DART_SDK_ZIP"
find "$DART_SDK_PATH" -type d -exec chmod 755 {} \;
find "$DART_SDK_PATH" -type f $IS_USER_EXECUTABLE -exec chmod a+x,a+r {} \;
echo "$ENGINE_VERSION" > "$ENGINE_STAMP"
# delete any temporary sdk path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment