Skip to content

setup.sh: tidy some shell-fu in order to detect 'flutter' and resolve 'dart' better - #10059

Open
srawlins wants to merge 2 commits into
flutter:masterfrom
srawlins:setup-sh
Open

srawlins wants to merge 2 commits into
flutter:masterfrom
srawlins:setup-sh

Conversation

@srawlins

Copy link
Copy Markdown
Contributor

Updated setup.sh to:

  • Move function flutter { ... } and export -f flutter below the FLUTTER_DIR detection and PATH export.
  • Switched command -v to type -P when resolving flutter / flutter.bat on PATH so it always returns a disk executable path even if a flutter shell function or alias is already exported in the parent shell environment.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors tool/ci/setup.sh to use type -P instead of command -v when resolving the Flutter executable on the PATH, ensuring it resolves to an actual executable rather than a shell function or alias. Additionally, the flutter shell function definition is moved down in the script. A review comment suggests improving the robustness of the flutter function for local Windows development by checking the OSTYPE environment variable in addition to RUNNER_OS.

Comment thread tool/ci/setup.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@srawlins
srawlins requested a review from johnpryan October 30, 2026 14:39
@kenzieschmoll
kenzieschmoll requested a review from DanTup October 30, 2026 17:17

@DanTup DanTup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants