<commit_before>path = require 'path'
{spawn} = require 'child_process'

pairSettings = ['version-string']
singleSettings = ['file-version', 'product-version', 'icon']

module.exports = (exe, options, callback) ->
  rcedit = path.resolve __dirname, '..', 'bin', 'rcedit.exe'
  args = [exe]

  for name in pairSettings
    if options[name]?
      for key, value of options[name]
        args.push "--set-#{name}"
        args.push key
        args.push value

  for name in singleSettings
    if options[name]?
      args.push "--set-#{name}"
      args.push options[name]

  child = spawn rcedit, args

  stderr = ''
  child.stderr.on 'data', (data) -> stderr += data
  child.on 'close', (code) ->
    if code is 0
      callback null<commit_msg>Add support for mac and linux with wine<commit_after>path = require 'path'
{spawn} = require 'child_process'

pairSettings = ['version-string']
singleSettings = ['file-version', 'product-version', 'icon']

module.exports = (exe, options, callback) ->
  rcedit = path.resolve __dirname, '..', 'bin', 'rcedit.exe'
  args = [exe]

  for name in pairSettings
    if options[name]?
      for key, value of options[name]
        args.push "--set-#{name}"
        args.push key
        args.push value

  for name in singleSettings
    if options[name]?
      args.push "--set-#{name}"
      args.push options[name]

  if process.platform != "win32"
    args.unshift(rcedit)
    rcedit = "wine"

  child = spawn rcedit, args

  stderr = ''
  child.stderr.on 'data', (data) -> stderr += data
  child.on 'close', (code) ->
    if code is 0
      callback null
{'fraction_non_alphanumeric': 0.14608150470219436, 'fraction_numerical': 0.0025078369905956114, 'mean_word_length': 2.902200488997555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5958489', 'n_tokens_mistral': 537, 'n_tokens_neox': 518, 'n_words': 150}