<commit_before>var path = require('path')
var os = require('os')

var download = require('electron-download')
var extract = require('extract-zip')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')

var mac = require('./mac.js')
var linux = require('./linux.js')
var win32 = require('./win32.js')

module.exports = function packager (opts, cb) {
  var packager
  var platform = opts.platform
  var arch = opts.arch
  var version = opts.version

  if (!platform || !arch || !version) cb(new Error('Must specify platform, arch and version'))

  switch (arch) {
    case 'ia32': break
    case 'x64': break
    default: return cb(new Error('Unsupported arch. Must be either ia32 or x64'))
  }

  switch (platform) {
    case 'darwin': packager = mac; break
    case 'linux': packager = linux; break
    case 'win32': packager = win32; break
    default: return cb(new Error('Unsupported platform. Must be either darwin, linux, or win32'))
  }

  download({
    platform: platform,
    arch: arch,
    version: version
  }, function (err, zipPath) {
    if (err) return cb(err)
    console.error('Packaging app for platform', platform + ' ' + arch, 'using electron v' + version)
    // extract zip into tmp so that packager can use it as a template
    var tmpDir = path.join(os.tmpdir(), 'electron-packager-' + platform + '-template')
    rimraf(tmpDir, function (err) {
      if (err) {} // ignore err
      mkdirp(tmpDir, function (err) {
        if (err) return cb(err)
        extract(zipPath, {dir: tmpDir}, function (err) {
          if (err) return cb(err)
          packager.createApp(opts, tmpDir, cb)
        })
      })
    })
  })
}
<commit_msg>Ignore this and related modules<commit_after>var path = require('path')
var os = require('os')

var download = require('electron-download')
var extract = require('extract-zip')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')

var mac = require('./mac.js')
var linux = require('./linux.js')
var win32 = require('./win32.js')

module.exports = function packager (opts, cb) {
  var packager
  var platform = opts.platform
  var arch = opts.arch
  var version = opts.version

  if (!platform || !arch || !version) cb(new Error('Must specify platform, arch and version'))

  switch (arch) {
    case 'ia32': break
    case 'x64': break
    default: return cb(new Error('Unsupported arch. Must be either ia32 or x64'))
  }

  switch (platform) {
    case 'darwin': packager = mac; break
    case 'linux': packager = linux; break
    case 'win32': packager = win32; break
    default: return cb(new Error('Unsupported platform. Must be either darwin, linux, or win32'))
  }

  // Ignore this and related modules by default
  var default_ignores = ['node_modules/electron-prebuilt', 'node_modules/electron-packager', '.git']
  if (opts.ignore && !Array.isArray(opts.ignore)) opts.ignore = [opts.ignore]
  opts.ignore = (opts.ignore) ? opts.ignore.concat(default_ignores) : default_ignores

  download({
    platform: platform,
    arch: arch,
    version: version
  }, function (err, zipPath) {
    if (err) return cb(err)
    console.error('Packaging app for platform', platform + ' ' + arch, 'using electron v' + version)
    // extract zip into tmp so that packager can use it as a template
    var tmpDir = path.join(os.tmpdir(), 'electron-packager-' + platform + '-template')
    rimraf(tmpDir, function (err) {
      if (err) {} // ignore err
      mkdirp(tmpDir, function (err) {
        if (err) return cb(err)
        extract(zipPath, {dir: tmpDir}, function (err) {
          if (err) return cb(err)
          packager.createApp(opts, tmpDir, cb)
        })
      })
    })
  })
}

{'fraction_non_alphanumeric': 0.1381758601856909, 'fraction_numerical': 0.009830693610049153, 'mean_word_length': 3.269230769230769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '429273', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1129, 'n_words': 367}