Skip to content

Find VS Code installations with Spotlight query on macOS - #80477

Merged
jmagman merged 2 commits into
flutter:masterfrom
jmagman:vs-spotlight
Apr 17, 2021
Merged

jmagman merged 2 commits into
flutter:masterfrom
jmagman:vs-spotlight

Conversation

@jmagman

@jmagman jmagman commented Apr 15, 2021 •

Copy link
Copy Markdown
Member

In addition to hard-coded Applications VS Code install locations, on macOS also query Spotlight (the app search engine when you cmd-space) for all installs by searching with the command line tool mdfind for the app's bundle identifier (com.microsoft.VSCode or com.microsoft.VSCodeInsiders).

See also #80475 and #80479

@jmagman jmagman added tool Affects the "flutter" command-line tool. See also t: labels. platform-macos Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool labels Apr 15, 2021
@jmagman jmagman self-assigned this Apr 15, 2021
@google-cla google-cla Bot added the cla: yes label Apr 15, 2021
return _findInstalled(<_VsCodeInstallLocation>[
_VsCodeInstallLocation(
// Query Spotlight for unexpected installation locations.
final ProcessResult vsCodeSpotlightQueryResult = processManager.runSync(<String>[

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.

do we catch process exceptions in a higher scope? operating under the assumption this binary will either be removed or renamed some day.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. Let me add that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@christopherfujino christopherfujino 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

@jmagman
jmagman merged commit 7aa188b into flutter:master Apr 17, 2021
@jmagman
jmagman deleted the vs-spotlight branch April 17, 2021 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform-macos Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants