<commit_before>app = require 'app'
delegate = require 'atom_delegate'
path = require 'path'
Window = require 'window'

# All opened windows.
windows = []

# Quit when all windows are closed.
app.on 'window-all-closed', ->
  app.quit()

delegate.browserMainParts.preMainMessageLoopRun = ->
  win = new Window width: 800, height: 600, show: false
  win.loadUrl "file://#{__dirname}/../static/index.html"

  win.on 'destroyed', ->
    windows.splice windows.indexOf(win), 1

  windows.push win
  win.show()<commit_msg>Set bootstrapScript and resourcePath params in URL.<commit_after>app = require 'app'
delegate = require 'atom_delegate'
path = require 'path'
Window = require 'window'

resourcePath = path.dirname(__dirname)

# All opened windows.
windows = []

# Quit when all windows are closed.
app.on 'window-all-closed', ->
  app.quit()

openWindowWithParams = (pairs) ->
  win = new Window width: 800, height: 600, show: false, title: 'Atom'

  windows.push win
  win.on 'destroyed', ->
    windows.splice windows.indexOf(win), 1

  url = "file://#{resourcePath}/static/index.html"
  separator = '?'
  for pair in pairs
    url += "#{separator}#{pair.name}=#{pair.param}"
    separator = '&' if separator is '?'

  win.loadUrl url
  win.show()

delegate.browserMainParts.preMainMessageLoopRun = ->
  openWindowWithParams [
    {name: 'bootstrapScript', param: 'window-bootstrap'},
    {name: 'resourcePath', param: resourcePath},
  ]
{'fraction_non_alphanumeric': 0.14474599860821155, 'fraction_numerical': 0.009742519137091163, 'mean_word_length': 4.045614035087719, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '2830585', 'n_tokens_mistral': 479, 'n_tokens_neox': 456, 'n_words': 123}