sorbet: Regenerate homegrown RBI files with brew typecheck --update

- I needed to add some more `require`s to the `tty.rb` generator script
  since it failed to recognise `env_config` and Sorbet's `T` setup if I
  ran it not via `brew ruby`, and I couldn't get `brew ruby` to work
  within `safe_system` in the `typecheck` dev-cmd.
This commit is contained in:
Issy Long 2023-03-06 20:53:21 +00:00
parent 1295904986
commit 48802daf01
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 5 additions and 1 deletions

View File

@ -64,6 +64,9 @@ module Homebrew
tapioca_args = ["--exclude", *excluded_gems, "--typed-overrides", *typed_overrides]
tapioca_args << "--all" if args.update_all?
ohai "Updating homegrown RBI files..."
safe_system "bundle", "exec", "ruby", "sorbet/custom_generators/tty.rb"
ohai "Updating Tapioca RBI files..."
safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args
safe_system "bundle", "exec", "parlour"

View File

@ -1,12 +1,13 @@
# typed: true
# frozen_string_literal: true
require_relative "../../global"
require_relative "../../env_config"
require_relative "../../utils/tty"
File.open("#{File.dirname(__FILE__)}/../../utils/tty.rbi", "w") do |file|
file.write(<<~RUBY)
# typed: strict
# frozen_string_literal: true
module Tty
RUBY