<commit_before>require "language/node"

class NetlifyCli < Formula
  desc "Netlify command-line tool"
  homepage "https://www.netlify.com/docs/cli"
  url "https://registry.npmjs.org/netlify-cli/-/netlify-cli-2.43.0.tgz"
  sha256 "696a2a2ba38e64d1d5d33501e16a6f62982c8e4b7f06a8db8b7dbd76817292e9"
  head "https://github.com/netlify/cli.git"

  bottle do
    cellar :any_skip_relocation
    sha256 "1f7d8f4fe3a89751bd8d6decf69dcd182c42f15ca3815523d49b44f9c4436812" => :catalina
    sha256 "dc721060324e301a39dfd97e7bd83d289a01647729779d8d884eff94bedb2a99" => :mojave
    sha256 "1da7cf1fa5c67d330dbe2f8451db51d7e7b1a691c4bee864c5746c257900bf65" => :high_sierra
  end

  depends_on "node"

  uses_from_macos "expect" => :test

  def install
    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
    bin.install_symlink Dir["#{libexec}/bin/*"]
  end

  test do
    (testpath/"test.exp").write <<~EOS
      spawn #{bin}/netlify login
      expect "Opening"<commit_msg>netlify-cli 2.44.0<commit_after>require "language/node"

class NetlifyCli < Formula
  desc "Netlify command-line tool"
  homepage "https://www.netlify.com/docs/cli"
  url "https://registry.npmjs.org/netlify-cli/-/netlify-cli-2.44.0.tgz"
  sha256 "f0a74fc8caeec8f040ec58343d0b521744bea44531f866ff06963fa6eb2462fd"
  head "https://github.com/netlify/cli.git"

  bottle do
    cellar :any_skip_relocation
    sha256 "1f7d8f4fe3a89751bd8d6decf69dcd182c42f15ca3815523d49b44f9c4436812" => :catalina
    sha256 "dc721060324e301a39dfd97e7bd83d289a01647729779d8d884eff94bedb2a99" => :mojave
    sha256 "1da7cf1fa5c67d330dbe2f8451db51d7e7b1a691c4bee864c5746c257900bf65" => :high_sierra
  end

  depends_on "node"

  uses_from_macos "expect" => :test

  def install
    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
    bin.install_symlink Dir["#{libexec}/bin/*"]
  end

  test do
    (testpath/"test.exp").write <<~EOS
      spawn #{bin}/netlify login
      expect "Opening"
{'fraction_non_alphanumeric': 0.11201216421692854, 'fraction_numerical': 0.17992904206791688, 'mean_word_length': 4.927927927927928, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4701168', 'n_tokens_mistral': 1052, 'n_tokens_neox': 864, 'n_words': 108}