<commit_before>import { spawn } from 'child_process';

// This file is inspired by the Angular CLI (MIT License: https://angular.io/license).
// See https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/tasks/repo-init/executor.ts

export async function initGitRepo(root: string) {

  function execute(args: string[]) {
    return new Promise<void>((resolve, reject) => {
      spawn('git', args, { cwd: root })
        .on('close', (code: number) => code === 0 ? resolve() : reject(code));
    });
  }

  const hasCommand = await execute(['--version']).then(() => true, () => false);
  if (!hasCommand) {<commit_msg>[@foal/cli] Fix displayed when git is not installed<commit_after>import { spawn } from 'child_process';

// This file is inspired by the Angular CLI (MIT License: https://angular.io/license).
// See https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/tasks/repo-init/executor.ts

export async function initGitRepo(root: string) {

  function execute(args: string[]) {
    return new Promise<void>((resolve, reject) => {
      spawn('git', args, { cwd: root, shell: true })
        .on('close', (code: number) => code === 0 ? resolve() : reject(code));
    });
  }

  const hasCommand = await execute(['--version']).then(() => true, () => false);
  if (!hasCommand) {
    console.log('Git not installed. Skipping initialization of git.');
{'fraction_non_alphanumeric': 0.17464788732394365, 'fraction_numerical': 0.0014084507042253522, 'mean_word_length': 3.951219512195122, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 4, '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': '7143196', 'n_tokens_mistral': 434, 'n_tokens_neox': 423, 'n_words': 112}