Skip to content

Commit

Permalink
Use Node.js 18
Browse files Browse the repository at this point in the history
The installation docs state that the Twilio CLI only supports Node.js
18, and there are some minor compatability issues with Node.js 21, which
is what the `node` formula currently resolves to.

See-also: twilio/twilio-cli#560
  • Loading branch information
elyscape committed Nov 28, 2023
1 parent 0fa6678 commit aeb8c58
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Formula/twilio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ class Twilio < Formula
url "https://twilio-cli-prod.s3.amazonaws.com/twilio-v5.16.2/twilio-v5.16.2.tar.gz"
version "5.16.2"
sha256 "f6c36e3d444804aaabbc78dbbd098351cdb0c70d029c9a93ef1e5dd2baaa1c61"
depends_on "node"
depends_on "node@18"

def install
inreplace "bin/twilio", /^CLIENT_HOME=/, "export TWILIO_OCLIF_CLIENT_HOME=#{lib/"client"}\nCLIENT_HOME="
libexec.install Dir["*"]
bin.install_symlink libexec/"bin/twilio"
(bin/"twilio").write_env_script libexec/"bin/twilio", PATH: "#{Formula["node@18"].opt_bin}:$PATH"
end

def post_install
pid = spawn("node #{libexec}/welcome.js")
node = Formula["node@18"].opt_bin/"node"
pid = spawn("#{node} #{libexec}/welcome.js")
Process.wait pid
end
end

0 comments on commit aeb8c58

Please sign in to comment.