[homebrew] Modify the version string when updating the version

This is a follow-up to a96b4f6 which changed the script but introduced
the bug that it no longer updated the version string in the formula.

Fixes https://github.com/dart-lang/sdk/issues/40990.

Change-Id: I272d21d2c4a44161f697ba52da6bb74b1cc7c5f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142147
Reviewed-by: William Hesse <whesse@google.com>
1 file changed
tree: 2e1c3bd81f7344d4717c0a970bc238e31a761ca6
  1. bin/
  2. lib/
  3. .gitignore
  4. dart-beta.rb
  5. dart.rb
  6. dart@1.rb
  7. dart@2.0.rb
  8. dart@2.1.rb
  9. dart@2.10.rb
  10. dart@2.12.rb
  11. dart@2.2.rb
  12. dart@2.3.rb
  13. dart@2.4.rb
  14. dart@2.5.rb
  15. dart@2.6.rb
  16. dart@2.7.rb
  17. dart@2.8.rb
  18. dart@2.9.rb
  19. dart@2.rb
  20. pubspec.yaml
  21. README.md
README.md

Dart for Homebrew

This is the official Dart tap for homebrew.

Mac users can use these formulae to easily install and update Dart SDK. Both dev and stable channels are supported.

Initial setup

If you don't have homebrew, install it from their homepage.

Then, add this tap:

brew tap dart-lang/dart

Installing

To install the Dart SDK:

brew install dart

Tip: Once installed, homebrew will print the path to the Dart SDK. Use this path to configure Dart support in your IDE (like WebStorm).

Updating

Simply run:

brew update
brew upgrade dart

Dev Releases

To install dev channel releases, instead of the stable ones, add a --head flag after the brew commands:

brew install dart --head

Note, when updating dev releases, homebrew doesn't always update to the latest version (see https://github.com/Homebrew/legacy-homebrew/issues/13197). In order to upgrade to the latest dev release, run:

brew reinstall dart

Specific stable versions

To install a specific dart version run brew install dart@2.8. This installs the latest 2.8 release including security patches, i.e. 2.8.1.

To use the specific version in your IDE or in scripts use the SDK you find under /usr/local/opt/dart@2.8/libexec.

It is supported to install multiple dart versions in parallel. The dart executable in PATH will continue to link to the dart or dart-beta formula. Installing dart@2.8 alone doesn't add the dart executable to the user PATH.

SDK path

Many tools, such as editors, ask you to specify the Dart SDK installation directory. After installing via homebrew you can use the path HOMEBREW_INSTALL/opt/dart/libexec, where HOMEBREW_INSTALL is the path to your homebrew installation directory (running brew --prefix on the command line will display it).