<commit_before>#!/bin/bash -e

# Helper methods ##########################################
###########################################################

__check_dependencies() {
  __process_marker "Checking dependencies"
  {
    type rsync &> /dev/null && true
    __process_msg "'rsync' already installed"
  } || {
    __process_msg "Installing 'rsync'"
    apt-get install -y rsync
  }

  {
    type ssh &> /dev/null && true
    __process_msg "'ssh' already installed"
  } || {
    __process_msg "Installing 'ssh'"
    apt-get install -y ssh-client
  }

  {
    type docker &> /dev/null && true
    __process_msg "'docker' already installed, checking version"
    local docker_version=$(docker --version)
    if [[ "$docker_version" == *"$DOCKER_VERSION"* ]]; then
      __process_msg "'docker' $DOCKER_VERSION installed"
    else
      __process_error "Docker version $docker_version installed, required $DOCKER_VERSION"
      __process_error "Install docker using script \"
      https://raw.githubusercontent.com/Shippable/node/master/scripts/ubu_14.04_docker_1.13.sh"
      exit 1
    fi
  } || {
    __process_error "Docker not installed, install docker using script \
    https://raw.githubusercontent.com/Shippable/node/master/scripts/ubu_14.04_docker_1.13.sh"
    exit 1
  }
}

__print_runtime() {
  __process_marker "Installer runtime variables"<commit_msg>Fix dependency checks; check for jq and install if not present<commit_after>#!/bin/bash -e

# Helper methods ##########################################
###########################################################

__check_dependencies() {
  __process_marker "Checking dependencies"

  if type rsync &> /dev/null && true; then
    __process_msg "'rsync' already installed"
  else
    __process_msg "Installing 'rsync'"
    apt-get install -y rsync
  fi

  if type ssh &> /dev/null && true; then
    __process_msg "'ssh' already installed"
  else
    __process_msg "Installing 'ssh'"
    apt-get install -y ssh-client
  fi

  if type jq &> /dev/null && true; then
    __process_msg "'jq' already installed"
  else
    __process_msg "Installing 'jq'"
    apt-get install -y jq
  fi

  if type docker &> /dev/null && true; then
    __process_msg "'docker' already installed, checking version"
    local docker_version=$(docker --version)
    if [[ "$docker_version" == *"$DOCKER_VERSION"* ]]; then
      __process_msg "'docker' $DOCKER_VERSION installed"
    else
      __process_error "Docker version $docker_version installed, required $DOCKER_VERSION"
      __process_error "Install docker using script \"
      https://raw.githubusercontent.com/Shippable/node/master/scripts/ubu_14.04_docker_1.13.sh"
      exit 1
    fi
  else
    __process_error "Docker not installed, install docker using script \
    https://raw.githubusercontent.com/Shippable/node/master/scripts/ubu_14.04_docker_1.13.sh"
    exit 1
  fi
}

__print_runtime() {
  __process_marker "Installer runtime variables"
{'fraction_non_alphanumeric': 0.1692672998643148, 'fraction_numerical': 0.010854816824966078, 'mean_word_length': 3.748792270531401, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '456330', 'n_tokens_mistral': 963, 'n_tokens_neox': 898, 'n_words': 224}