<commit_before>const _ = require('lodash');
const shellUtils = require('shell-utils');
const fs = require('fs');

const release = _.includes(process.argv, 'release');

function hackReactXcodeScript() {
  const fileToHack = `./node_modules/react-native/packager/react-native-xcode.sh`;
  const lines = _.split(String(fs.readFileSync(fileToHack)), '\n');
  lines[11] = release ? '' : `exit 0;`;
  fs.writeFileSync(fileToHack, _.join(lines, '\n'));
}

function buildProjForDetox() {
  const scheme = release ? `playground_release_Detox` : `playground_Detox`;

  shellUtils.exec.execSync(`./scripts/detoxDebugFix.rb ${release ? '' : 'debug'}`);

  const cmd = `RCT_NO_LAUNCH_PACKAGER=true
          cd ios && xcodebuild
            -scheme ${scheme} build
            -project playground.xcodeproj
            -sdk iphonesimulator
            -derivedDataPath ./DerivedData/playground`;

  if (shellUtils.exec.execSyncRead(`which xcpretty`)) {
    shellUtils.exec.execSync(`${cmd} | xcpretty && exit ${PIPESTATUS[0]}`);
  } else {
    shellUtils.exec.execSync(`${cmd}`);<commit_msg>fix script<commit_after>const _ = require('lodash');
const shellUtils = require('shell-utils');
const fs = require('fs');

const release = _.includes(process.argv, 'release');

function hackReactXcodeScript() {
  const fileToHack = `./node_modules/react-native/packager/react-native-xcode.sh`;
  const lines = _.split(String(fs.readFileSync(fileToHack)), '\n');
  lines[11] = release ? '' : `exit 0;`;
  fs.writeFileSync(fileToHack, _.join(lines, '\n'));
}

function buildProjForDetox() {
  const scheme = release ? `playground_release_Detox` : `playground_Detox`;

  shellUtils.exec.execSync(`./scripts/detoxDebugFix.rb ${release ? '' : 'debug'}`);

  const cmd = `RCT_NO_LAUNCH_PACKAGER=true
          cd ios && xcodebuild
            -scheme ${scheme} build
            -project playground.xcodeproj
            -sdk iphonesimulator
            -derivedDataPath ./DerivedData/playground`;

  if (hasXcpretty()) {
    shellUtils.exec.execSync(`${cmd} | xcpretty && exit ${PIPESTATUS[0]}`);
  } else {
    shellUtils.exec.execSync(`${cmd}`);
  }
}
function hasXcpretty() {
  try {
    return shellUtils.exec.execSyncRead(`which xcpretty`);
  } catch (e) {
    return false;
{'fraction_non_alphanumeric': 0.15985790408525755, 'fraction_numerical': 0.003552397868561279, 'mean_word_length': 3.8660907127429804, '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': '7460945', 'n_tokens_mistral': 775, 'n_tokens_neox': 759, 'n_words': 133}