<commit_before>#!/bin/bash

panic() {
  if [[ ${1+isset} = isset ]]; then
    echo ${1} 1>&2
  fi
  exit ${2:-1}
}

check_requirements() {
  if [ ! -f /etc/os-release ]; then
    panic "Cannot detect OS"
  fi

  source /etc/os-release
  if [[ "${ID}" != "ubuntu" ]]; then
    panic "Detected unsupported OS: ${ID} <${PRETTY_NAME}>"
  fi
}

check_requirements

sudo apt-get update
sudo apt-get dist-upgrade --yes --force-yes
sudo apt-get install ansible

ansible-playbook -i inventory/localhost --extra-vars="roles=ansible" bootstrap.yml -K -vvvv $@
ansible-playbook -i inventory/localhost --extra-vars="roles=common" bootstrap.yml -K -vvvv $@<commit_msg>Install ansible only if needed.<commit_after>#!/bin/bash

panic() {
  if [[ ${1+isset} = isset ]]; then
    echo ${1} 1>&2
  fi
  exit ${2:-1}
}

check_requirements() {
  if [ ! -f /etc/os-release ]; then
    panic "Cannot detect OS"
  fi

  source /etc/os-release
  if [[ "${ID}" != "ubuntu" ]]; then
    panic "Detected unsupported OS: ${ID} <${PRETTY_NAME}>"
  fi
}

check_requirements

if ! command -v ansible-playbook >/dev/null 2>&1; then
  sudo apt-get update
  sudo apt-get dist-upgrade --yes --force-yes
  sudo apt-get install ansible
fi

ansible-playbook -i inventory/localhost --extra-vars="roles=ansible" bootstrap.yml -K -vvvv $@
ansible-playbook -i inventory/localhost --extra-vars="roles=common" bootstrap.yml -K -vvvv $@
{'fraction_non_alphanumeric': 0.1683453237410072, 'fraction_numerical': 0.010071942446043165, 'mean_word_length': 3.3605015673981193, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4386122', 'n_tokens_mistral': 537, 'n_tokens_neox': 501, 'n_words': 138}