<commit_before>{BufferedProcess} = require 'atom'
path = require 'path'

class Generator
  hugoProcess = null

  @config =
    srcPath: ''
    documentsPath: './content'
    outPath: './public'
    theme: 'hyde'

  @run: (callback) ->
    projectPath = atom.config.get 'docapp.projectPath'
    command = path.resolve(projectPath, "./bin/hugo-#{process.platform}")
    args = [
      '-s', projectPath ,
      "--theme=#{atom.config.get 'docapp.theme'}" ,
      '-b', "http://localhost:#{atom.config.get 'docapp.serverPort'}/"
      '-w'
    ]
    hugoProcess = new BufferedProcess
      command: command
      args: args
      stdout: (output) ->
        if atom.htmlTab?
          if output.indexOf 'Change detected' is not -1
            atom.htmlTab.reload()
#            atom.nprogress.done()
#        console.log output
      stderr: (err) ->
        console.error err
      exit: (code) ->
        console.log "exited with #{code}"
    hugoProcess.onWillThrowError (error) ->
      console.error(error)
    window.addEventListener 'beforeunload', ->
      hugoProcess.kill()
    callback()

module.exports = Generator<commit_msg>fix hugo generator binary names<commit_after>{BufferedProcess} = require 'atom'
path = require 'path'

class Generator
  hugoProcess = null

  @config =
    srcPath: ''
    documentsPath: './content'
    outPath: './public'
    theme: 'hyde'

  @run: (callback) ->
    projectPath = atom.config.get 'docapp.projectPath'
    command = path.resolve(projectPath, "./bin/hugo-#{process.platform}")
    if process.arch is 'x64' or process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432')
      command = command + "-x64"
    else
      command = command + "-x32"
    args = [
      '-s', projectPath ,
      "--theme=#{atom.config.get 'docapp.theme'}" ,
      '-b', "http://localhost:#{atom.config.get 'docapp.serverPort'}/"
      '-w'
    ]
    hugoProcess = new BufferedProcess
      command: command
      args: args
      stdout: (output) ->
        if atom.htmlTab?
          if output.indexOf 'Change detected' is not -1
            atom.htmlTab.reload()
#            atom.nprogress.done()
#        console.log output
      stderr: (err) ->
        console.error err
      exit: (code) ->
        console.log "exited with #{code}"
    hugoProcess.onWillThrowError (error) ->
      console.error(error)
    window.addEventListener 'beforeunload', ->
      hugoProcess.kill()
    callback()

module.exports = Generator
{'fraction_non_alphanumeric': 0.1417483660130719, 'fraction_numerical': 0.004901960784313725, 'mean_word_length': 2.4347826086956523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1044876', 'n_tokens_mistral': 767, 'n_tokens_neox': 766, 'n_words': 168}