<commit_before>const shell = require('shelljs');

const cmdArguments = process.argv.slice(2);
const semverType = cmdArguments[0];

if(!semverType || !semverType.match(/^(major|minor|patch)$/)) {
    console.log(`Usage: major|minor|patch`);
    process.exit(1);
}

execCommand(`npm version ${semverType}`);
execCommand(`yarn run build`);
execCommand(`yarn run test:rules`);
execCommand(`git push`);
execCommand(`git push --tags`);
execCommand(`yarn publish`);

function execCommand(command) {
    const result = shell.exec(command);
    if(!!result.code) {
        console.log(result.stdout);
        process.exit(1);
    }
}<commit_msg>fix publish js<commit_after>const shell = require("shelljs");

const cmdArguments = process.argv.slice(2);
const semverType = cmdArguments[0];

if (!semverType || !semverType.match(/^(major|minor|patch)$/)) {
  console.log(`Usage: major|minor|patch`);
  process.exit(1);
}

execCommand(`npm version ${semverType}`);
execCommand(`yarn run build`);
execCommand(`yarn run test`);
execCommand(`git push`);
execCommand(`git push --tags`);
execCommand(`yarn publish`);

function execCommand(command) {
  const result = shell.exec(command);
  if (!!result.code) {
    console.log(result.stdout);
    process.exit(1);
  }
}
{'fraction_non_alphanumeric': 0.1782573940847322, 'fraction_numerical': 0.006394884092725819, 'mean_word_length': 5.554973821989528, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7105819', 'n_tokens_mistral': 409, 'n_tokens_neox': 413, 'n_words': 80}