<commit_before>/*
 * Copyright 2021 <NAME> <<EMAIL>>
 *
 * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.
 */
require('shelljs/global');
const path = require('path');
const fs = require('fs');
const dependencyPruner = require('./dependency_pruner');
const log = console.log.bind(console);
const utilities = require('./packaging_utilities');

const qtConfig = require("@nodegui/nodegui/config/qtConfig");

async function makePackage({ arch, platform, version, outputDir }) {
  log("");
  const SRC_DIR = "" + pwd();

  fixNodeModulesSubProjects();

  // Clean up the output dirs and files first.
  const versionedDirName = createOutputDirName({version, platform, arch});
  const versionedOutputDir = path.join(outputDir, versionedDirName);

  if (test('-d', versionedOutputDir)) {
    rm('-rf', versionedOutputDir);
  }

  echo("Copying source tree to versioned directory...");
  utilities.copySourceTree(SRC_DIR, versionedOutputDir, ignoreRegExp);

  const thisCD = pwd();
  cd(outputDir);

  await pruneNodeGui(versionedOutputDir, platform);

  hoistSubprojectsModules(versionedOutputDir, platform);

  dependencyPruner.pruneDevDependencies(SRC_DIR, versionedOutputDir);
  pruneNodeModules(versionedOutputDir, platform);
  // pruneTwemoji(versionedOutputDir, platform);

  addLauncher(versionedOutputDir, platform);

  runDeployQt(SRC_DIR, versionedOutputDir);

  log("Zipping up the package");

  if (platform === "linux") {
    cp(path.join(SRC_DIR, "main/resources/extraterm.desktop"), versionedOutputDir);
  }

  const linkOption = process.platform === "win32" ? "" : " -y";
  cd(outputDir);
  const outputZip = versionedDirName + ".zip";
  exec(`zip ${linkOption} -r ${outputZip} ${versionedDirName}`);
  cd(thisCD);

  log("App bundle written to " + versionedOutputDir);
  return true;
}

exports.makePackage = makePackage;
<commit_msg>Remove the unneeded list-fonts exe from packages<commit_after>/*
 * Copyright 2021 <NAME> <<EMAIL>>
 *
 * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.
 */
require('shelljs/global');
const path = require('path');
const fs = require('fs');
const dependencyPruner = require('./dependency_pruner');
const log = console.log.bind(console);
const utilities = require('./packaging_utilities');

const qtConfig = require("@nodegui/nodegui/config/qtConfig");

async function makePackage({ arch, platform, version, outputDir }) {
  log("");
  const SRC_DIR = "" + pwd();

  fixNodeModulesSubProjects();

  // Clean up the output dirs and files first.
  const versionedDirName = createOutputDirName({version, platform, arch});
  const versionedOutputDir = path.join(outputDir, versionedDirName);

  if (test('-d', versionedOutputDir)) {
    rm('-rf', versionedOutputDir);
  }

  echo("Copying source tree to versioned directory...");
  utilities.copySourceTree(SRC_DIR, versionedOutputDir, ignoreRegExp);

  const thisCD = pwd();
  cd(outputDir);

  await pruneNodeGui(versionedOutputDir, platform);

  hoistSubprojectsModules(versionedOutputDir, platform);

  dependencyPruner.pruneDevDependencies(SRC_DIR, versionedOutputDir);
  pruneNodeModules(versionedOutputDir, platform);
  // pruneTwemoji(versionedOutputDir, platform);
  pruneListFontsJsonExe(versionedOutputDir, platform);

  addLauncher(versionedOutputDir, platform);

  runDeployQt(SRC_DIR, versionedOutputDir);

  log("Zipping up the package");

  if (platform === "linux") {
    cp(path.join(SRC_DIR, "main/resources/extraterm.desktop"), versionedOutputDir);
  }

  const linkOption = process.platform === "win32" ? "" : " -y";
  cd(outputDir);
  const outputZip = versionedDirName + ".zip";
  exec(`zip ${linkOption} -r ${outputZip} ${versionedDirName}`);
  cd(thisCD);

  log("App bundle written to " + versionedOutputDir);
  return true;
}

exports.makePackage = makePackage;

{'fraction_non_alphanumeric': 0.13410852713178295, 'fraction_numerical': 0.0031007751937984496, 'mean_word_length': 5.387788778877888, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7231603', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1182, 'n_words': 282}