<commit_before>#!/usr/bin/env node

const argv = require('yargs').argv;

const exec = require('execa').sync;

const getVersion = require('../app/util/get-version');

const pkg = require('../app/package');

const {
  nightly,
  publish,
  config
} = argv;

let nightlyVersion = nightly && getVersion(pkg, {
  nightly: 'nightly'
});

if (nightlyVersion) {

  const publishNightlyArgs = [
    'publish',
    `--repo-version=${nightlyVersion}`,
    '--skip-npm',
    '--skip-git',
    '--yes'
  ];

  console.log(`
Bumping ${pkg.name} version to ${nightlyVersion}

---

lerna ${ publishNightlyArgs.join(' ') }

---
`);

  exec('lerna', publishNightlyArgs, {
    stdio: 'inherit'
  });
}

const replaceVersion = nightlyVersion
  ? s => s.replace('${version}', 'nightly')
  : s => s;

const artifactOptions = [
  '-c.artifactName=${name}-${version}-${os}-${arch}.${ext}',
  '-c.dmg.artifactName=${name}-${version}-${os}.${ext}',
  '-c.nsis.artifactName=${name}-${version}-${os}-setup.${ext}',
  '-c.nsisWeb.artifactName=${name}-${version}-${os}-web-setup.${ext}',
  argv.compress === false && '-c.compression=store'
].filter(f => f).map(replaceVersion);

// interpret shorthand target options
// --win, --linux, --mac
const platforms = [
  argv.win ? 'win' : null,
  argv.linux ? 'linux': null,
  argv.mac ? 'mac' : null
].filter(f => f);<commit_msg>chore(distro): build script style fixes<commit_after>#!/usr/bin/env node

const argv = require('yargs').argv;

const exec = require('execa').sync;

const getVersion = require('../app/util/get-version');

const pkg = require('../app/package');

const {
  nightly,
  publish,
  config
} = argv;

const nightlyVersion = nightly && getVersion(pkg, {
  nightly: 'nightly'
});

if (nightlyVersion) {

  const publishNightlyArgs = [
    'publish',
    `--repo-version=${nightlyVersion}`,
    '--skip-npm',
    '--skip-git',
    '--yes'
  ];

  console.log(`
Bumping ${pkg.name} version to ${nightlyVersion}

---

lerna ${ publishNightlyArgs.join(' ') }

---
`);

  exec('lerna', publishNightlyArgs, {
    stdio: 'inherit'
  });
}

const replaceVersion = nightly
  ? s => s.replace('${version}', 'nightly')
  : s => s;

const artifactOptions = [
  '-c.artifactName=${name}-${version}-${os}-${arch}.${ext}',
  '-c.dmg.artifactName=${name}-${version}-${os}.${ext}',
  '-c.nsis.artifactName=${name}-${version}-${os}-setup.${ext}',
  '-c.nsisWeb.artifactName=${name}-${version}-${os}-web-setup.${ext}',
  argv.compress === false && '-c.compression=store'
].filter(f => f).map(replaceVersion);

// interpret shorthand target options
// --win, --linux, --mac
const platforms = [
  argv.win ? 'win' : null,
  argv.linux ? 'linux': null,
  argv.mac ? 'mac' : null
].filter(f => f);
{'fraction_non_alphanumeric': 0.23145071982281284, 'fraction_numerical': 0.0, 'mean_word_length': 3.6643717728055076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1405763', 'n_tokens_mistral': 992, 'n_tokens_neox': 968, 'n_words': 173}