<commit_before># Builds binary brew package
require 'cmd/install'

Homebrew.install_formulae ARGV.formulae

destination = HOMEBREW_PREFIX + "Bottles"
if not File.directory?(destination)
  Dir.mkdir destination
end

ARGV.each do|formula|
  # Get the latest version
  version = `brew list --versions #{formula}`.split.last
  source = HOMEBREW_CELLAR + formula + version
  filename = formula + '-' + version + '-bottle.tar.gz'
  ohai "Bottling #{formula} #{version}..."
  HOMEBREW_CELLAR.cd do
    # Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
    # or an uncompressed tarball (and more bandwidth friendly).
    safe_system 'tar', 'czf', "#{destination}/#{filename}", "#{formula}/#{version}"
    sha1 = Pathname.new("#{destination}/#{filename}").sha1
    ohai "Bottled #{filename}"
    ohai "SHA1 #{sha1}"
  end
end<commit_msg>Commands should not have side-effects<commit_after># Builds binary brew package
require 'cmd/install'

destination = HOMEBREW_PREFIX + "Bottles"
Dir.mkdir destination unless File.directory? destination

ARGV.each do|formula|
  # Get the latest version
  version = `brew list --versions #{formula}`.split.last

  if version.nil?
    onoe "Formula not installed: #{formula}"
    next
  end

  source = HOMEBREW_CELLAR + formula + version
  filename = "#{formula}-#{version}-bottle.tar.gz"
  ohai "Bottling #{formula} #{version}..."
  HOMEBREW_CELLAR.cd do
    # Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
    # or an uncompressed tarball (and more bandwidth friendly).
    safe_system 'tar', 'czf', "#{destination}/#{filename}", "#{formula}/#{version}"
    sha1 = Pathname.new("#{destination}/#{filename}").sha1
    ohai "Bottled #{filename}"
    ohai "SHA1 #{sha1}"
  end
end
{'fraction_non_alphanumeric': 0.13431986340352875, 'fraction_numerical': 0.006829823562891292, 'mean_word_length': 4.263473053892215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '924497', 'n_tokens_mistral': 590, 'n_tokens_neox': 566, 'n_words': 163}