lib/tapioca/compilers/sorbet.rb in tapioca-0.4.15 vs lib/tapioca/compilers/sorbet.rb in tapioca-0.4.16
- old
+ new
@@ -6,10 +6,11 @@
module Tapioca
module Compilers
module Sorbet
SORBET = Pathname.new(Gem::Specification.find_by_name("sorbet-static").full_gem_path) / "libexec" / "sorbet"
+ EXE_PATH_ENV_VAR = "TAPIOCA_SORBET_EXE"
class << self
extend(T::Sig)
sig { params(args: String).returns(String) }
@@ -24,10 +25,12 @@
).read
end
sig { returns(String) }
def sorbet_path
- SORBET.to_s.shellescape
+ sorbet_path = ENV.fetch(EXE_PATH_ENV_VAR, SORBET)
+ sorbet_path = SORBET if sorbet_path.empty?
+ sorbet_path.to_s.shellescape
end
end
end
end
end