<commit_before>module Mina
  class Commands
    alias :mina_run :run

    def run(backend)
      backend == :remote ? on_each_server { mina_run(backend) } : mina_run(backend)
    end
  end

  module Helpers::Internal
    def on_each_server
      ensure!(:servers)
      fetch(:servers).each do |server|
        print_stdout "Server: #{server}"
        set(:domain, server)
        yield
      end
    end
  end
end<commit_msg>Restore 'domain' variable to its previous value<commit_after>module Mina
  class Commands
    alias :mina_run :run

    def run(backend)
      backend == :remote ? on_each_server { mina_run(backend) } : mina_run(backend)
    end
  end

  module Helpers::Internal
    def on_each_server
      ensure!(:servers)
      fetch(:servers).each do |server|
        print_stdout "Server: #{server}"
        on_domain(server) { yield }
      end
    end

    def on_domain(domain)
      prev_domain = ENV['domain']
      ENV['domain'] = domain
      yield
      ENV['domain'] = prev_domain
    end
  end
end
{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.0, 'mean_word_length': 2.657142857142857, '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': '6310424', 'n_tokens_mistral': 327, 'n_tokens_neox': 323, 'n_words': 82}