<commit_before>'use strict'

import {View} from './view'
import {spawnAPM} from './helpers'

export class Installer {
  constructor(name, packages) {
    this.name = name
    this.packages = packages
  }
  async install() {
    const view = new View(this.name, this.packages)
    try {
      await spawnAPM(this.packages, function() {
        view.advance()
      })
    } catch (error) {
      view.dismiss()
      atom.notifications.addError(`Error installing ${this.name} dependencies`, {
        detail: error.stack,
        dismissable: true
      })
    } finally {
      await Promise.all(this.packages.map(name => atom.packages.activatePackage(name)))
    }
  }
}<commit_msg>:new: Properly mark view as completed<commit_after>'use strict'

import {View} from './view'
import {spawnAPM} from './helpers'

export class Installer {
  constructor(name, packages) {
    this.name = name
    this.packages = packages
  }
  async install() {
    const view = new View(this.name, this.packages)
    try {
      await spawnAPM(this.packages, function() {
        view.advance()
      })
      view.markFinished()
    } catch (error) {
      view.dismiss()
      atom.notifications.addError(`Error installing ${this.name} dependencies`, {
        detail: error.stack,
        dismissable: true
      })
    } finally {
      await Promise.all(this.packages.map(name => atom.packages.activatePackage(name)))
    }
  }
}
{'fraction_non_alphanumeric': 0.1306497175141243, 'fraction_numerical': 0.0, 'mean_word_length': 2.7289473684210526, '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': '5846350', 'n_tokens_mistral': 429, 'n_tokens_neox': 429, 'n_words': 98}