<commit_before>path = require 'path'

CSON = require 'season'

config = require './config'
fs = require './fs'
Installer = require './installer'

module.exports =
class Updater
  run: (options) ->
    {devDependencies, dependencies} = CSON.readFileSync(CSON.resolve('package')) ? {}
    devDependencies ?= {}
    dependencies ?= {}
    for installedModule in fs.list('node_modules')
      continue if installedModule is '.bin'
      continue if dependencies.hasOwnProperty(installedModule)
      continue if devDependencies.hasOwnProperty(installedModule)

      process.stdout.write("Removing #{installedModule} ")
      try
        fs.rm(path.resolve('node_modules', installedModule))
        process.stdout.write '\u2713\n'.green
      catch e
        process.stdout.write '\u2717\n'.red

    new Installer().installDependencies(options)<commit_msg>Don't uninstall apm during update<commit_after>path = require 'path'

CSON = require 'season'

config = require './config'
fs = require './fs'
Installer = require './installer'

module.exports =
class Updater
  run: (options) ->
    {devDependencies, dependencies} = CSON.readFileSync(CSON.resolve('package')) ? {}
    devDependencies ?= {}
    dependencies ?= {}
    for installedModule in fs.list('node_modules')
      continue if installedModule is '.bin'
      continue if installedModule is 'atom-package-manager'
      continue if dependencies.hasOwnProperty(installedModule)
      continue if devDependencies.hasOwnProperty(installedModule)

      process.stdout.write("Removing #{installedModule} ")
      try
        fs.rm(path.resolve('node_modules', installedModule))
        process.stdout.write '\u2713\n'.green
      catch e
        process.stdout.write '\u2717\n'.red

    new Installer().installDependencies(options)
{'fraction_non_alphanumeric': 0.12051569506726457, 'fraction_numerical': 0.008968609865470852, 'mean_word_length': 3.6484375, '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': '5787964', 'n_tokens_mistral': 513, 'n_tokens_neox': 490, 'n_words': 114}