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

INSTALLATION_LINE_PATTERN = /^Installing +([^@]+)@(\S+).+\s+(\S+)$/

module.exports =
  updatePackages: (isAutoUpdate = true) ->
    @runApmUpgrade (log) =>
      entries = @parseLog(log)
      summary = @generateSummary(entries, isAutoUpdate)
      return unless summary
      @notify
        title: 'Atom Package Updates'
        message: summary
        sender: 'com.github.atom'

  runApmUpgrade: (callback) ->
    command = atom.packages.getApmPath()
    args = ['upgrade', '--no-confirm', '--no-color']

    log = ''

    stdout = (data) ->
      log += data

    exit = (exitCode) -><commit_msg>Open Atom when the notification is clicked<commit_after>path = require 'path'
glob = require 'glob'
{BufferedProcess} = require 'atom'

ATOM_BUNDLE_IDENTIFIER = 'com.github.atom'
INSTALLATION_LINE_PATTERN = /^Installing +([^@]+)@(\S+).+\s+(\S+)$/

module.exports =
  updatePackages: (isAutoUpdate = true) ->
    @runApmUpgrade (log) =>
      entries = @parseLog(log)
      summary = @generateSummary(entries, isAutoUpdate)
      return unless summary
      @notify
        title: 'Atom Package Updates'
        message: summary
        sender: ATOM_BUNDLE_IDENTIFIER
        activate: ATOM_BUNDLE_IDENTIFIER

  runApmUpgrade: (callback) ->
    command = atom.packages.getApmPath()
    args = ['upgrade', '--no-confirm', '--no-color']

    log = ''

    stdout = (data) ->
      log += data

    exit = (exitCode) ->
{'fraction_non_alphanumeric': 0.15211640211640212, 'fraction_numerical': 0.0, 'mean_word_length': 3.023936170212766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4861844', 'n_tokens_mistral': 516, 'n_tokens_neox': 502, 'n_words': 110}