<commit_before>require('./patches/gherkin')
require('./keyboard/bindings')

const electron = require('electron')
const Cucumber = require('cucumber')

const Options = require('../cli/options')
const Output = require('./output')

const output = new Output()
const options = new Options(electron.remote.process.argv)

process.on('unhandledRejection', function(reason) {
  output.write(reason.message + "\n" + reason.stack)
  exitWithCode(3)
})

function exitWithCode(code) {
  if (options.electronDebug) return
  electron.remote.getGlobal('console').log("EXITING WITH CODE", code)
  electron.remote.process.exit(code)
}

try {
  const argv = options.cucumberArgv
  const cwd = process.cwd()
  const stdout = new Output()
  new Cucumber.Cli({ argv, cwd, stdout }).run()
    .then(pass => exitWithCode(pass ? 0 : 1))
} catch (err) {
  log(err.stack)
  exitWithCode(2)
}
<commit_msg>Remove console.log about exit code<commit_after>require('./patches/gherkin')
require('./keyboard/bindings')

const electron = require('electron')
const Cucumber = require('cucumber')

const Options = require('../cli/options')
const Output = require('./output')

const output = new Output()
const options = new Options(electron.remote.process.argv)

process.on('unhandledRejection', function(reason) {
  output.write(reason.message + "\n" + reason.stack)
  exitWithCode(3)
})

function exitWithCode(code) {
  if (options.electronDebug) return
  electron.remote.process.exit(code)
}

try {
  const argv = options.cucumberArgv
  const cwd = process.cwd()
  const stdout = new Output()
  new Cucumber.Cli({ argv, cwd, stdout }).run()
    .then(pass => exitWithCode(pass ? 0 : 1))
} catch (err) {
  log(err.stack)
  exitWithCode(2)
}

{'fraction_non_alphanumeric': 0.1540714704159344, 'fraction_numerical': 0.0046865846514352666, 'mean_word_length': 4.750841750841751, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '870511', 'n_tokens_mistral': 574, 'n_tokens_neox': 561, 'n_words': 126}