<commit_before>const path = require('path');
const fs = require('fs');

const getVersion = require('./getVersion');

getVersion((version) => {
  const pathSource = path.join(process.cwd(), process.argv[ 2 ]);
  const pathLicense = path.join(process.cwd(), 'LICENSE.txt');

  const source = fs.readFileSync(pathSource, 'utf8');
  const license = fs.readFileSync(pathLicense, 'utf8');

  const header = `/*\n${license}\n*/\n\n/* version: ${version} */`;

  fs.writeFileSync(pathSource, `${header}\n\n${source}`);
});<commit_msg>Implemented dropping replacing '{{versionString}}' with version<commit_after>'use strict';

const path = require('path');
const fs = require('fs');

const getVersion = require('./getVersion');

getVersion((err, version) => {
  if(err) {
    throw err;
  }

  const pathSource = path.join(process.cwd(), process.argv[ 2 ]);
  const pathLicense = path.join(process.cwd(), 'LICENSE.txt');

  const license = fs.readFileSync(pathLicense, 'utf8');
  const header = `/*\n${license}\n*/\n\n/* version: ${version} */`;

  let source = fs.readFileSync(pathSource, 'utf8');

  // this is not nice to do here but it's quick and dirty
  // within the source of the app theres a string like
  // {{versionString}}
  // we want to replace that with the generated version
  source = source.replace('{{versionString}}', version);

  fs.writeFileSync(pathSource, `${header}\n\n${source}`);
});
{'fraction_non_alphanumeric': 0.18544935805991442, 'fraction_numerical': 0.0042796005706134095, 'mean_word_length': 4.567460317460317, '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': '3600046', 'n_tokens_mistral': 451, 'n_tokens_neox': 442, 'n_words': 114}