<commit_before>#!/usr/bin/env bash

set -o errexit -o nounset

####################################
# repo specific variables should be set in .travis.yml
####################################
# TRIGGER_REPO_SLUG="patternfly/patternfly"
# TRIGGER_REPO_BRANCH="master"
####################################
####################################

SCRIPT=`basename $0`
ACTION="Manual"
REPO_NAME="origin"
SOURCE_BRANCH=`git rev-parse --abbrev-ref HEAD`
QUIET=false
USE_SITE_REPO=false
PUSH_REPO=false
PUSH_BRANCH="gh-pages"
BOWER_WEB_FILES_ONLY=false

RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[1;32m'
NC='\033[0m' # No Color

echoHeader () {
  echo
  echo -e "${YELLOW}################################################################################${NC}"
  echo -e "${GREEN}${@}${NC}"
  echo -e "${YELLOW}################################################################################${NC}"
}

confirm () {
  if $QUIET; then
    true
  else
    # call with a prompt string or use a default
    QUESTION="${1:-Are you sure? [y/N]} "
    echo -e -n $QUESTION
    read -r RESPONSE
    case $RESPONSE in
      [yY][eE][sS]|[yY])
        true
        ;;
      *)
        false
        ;;
    esac
  fi
}

setUserInfo () {
  git config --global user.name "patternfly-build"
  git config --global user.email "<EMAIL>"
  git config --global push.default simple
}

getDeployKey () {
  if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
    echo "${RED}The travis ecrypted key var is not available to builds triggered by pull requests.  Aborting.${NC}"
    exit 0
  fi
  # Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
  ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
  ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
  echo "Checking Travis ENV VAR: ${ENCRYPTED_KEY_VAR}..."
  ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
  echo "Checking Travis ENV VAR: ${ENCRYPTED_IV_VAR}..."
  ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
  openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d
  chmod 600 deploy_key
  eval `ssh-agent -s`
  ssh-add deploy_key
}

checkTriggerRepo () {
  echo "$TRAVIS_REPO_SLUG $TRIGGER_REPO_SLUG $TRIGGER_REPO_BRANCH"
  if [ "${TRAVIS_REPO_SLUG}" = "${TRIGGER_REPO_SLUG}" ]; then
    echo "This action is running against ${TRIGGER_REPO_SLUG}."
    if [ -z "${TRAVIS_TAG}" -a "${TRAVIS_BRANCH}" != "${TRIGGER_REPO_BRANCH}" ]; then
      echo "This commit was made against ${TRAVIS_BRANCH} and not the ${TRIGGER_REPO_BRANCH} branch. Aborting."
      exit 1
    fi<commit_msg>Fixed the color output of the previously committed error message<commit_after>#!/usr/bin/env bash

set -o errexit -o nounset

####################################
# repo specific variables should be set in .travis.yml
####################################
# TRIGGER_REPO_SLUG="patternfly/patternfly"
# TRIGGER_REPO_BRANCH="master"
####################################
####################################

SCRIPT=`basename $0`
ACTION="Manual"
REPO_NAME="origin"
SOURCE_BRANCH=`git rev-parse --abbrev-ref HEAD`
QUIET=false
USE_SITE_REPO=false
PUSH_REPO=false
PUSH_BRANCH="gh-pages"
BOWER_WEB_FILES_ONLY=false

RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[1;32m'
NC='\033[0m' # No Color

echoHeader () {
  echo
  echo -e "${YELLOW}################################################################################${NC}"
  echo -e "${GREEN}${@}${NC}"
  echo -e "${YELLOW}################################################################################${NC}"
}

confirm () {
  if $QUIET; then
    true
  else
    # call with a prompt string or use a default
    QUESTION="${1:-Are you sure? [y/N]} "
    echo -e -n $QUESTION
    read -r RESPONSE
    case $RESPONSE in
      [yY][eE][sS]|[yY])
        true
        ;;
      *)
        false
        ;;
    esac
  fi
}

setUserInfo () {
  git config --global user.name "patternfly-build"
  git config --global user.email "<EMAIL>"
  git config --global push.default simple
}

getDeployKey () {
  if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
    echo -e "${RED}The travis ecrypted key var is not available to builds triggered by pull requests.  Aborting.${NC}"
    exit 0
  fi
  # Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
  ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
  ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
  echo "Checking Travis ENV VAR: ${ENCRYPTED_KEY_VAR}..."
  ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
  echo "Checking Travis ENV VAR: ${ENCRYPTED_IV_VAR}..."
  ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
  openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d
  chmod 600 deploy_key
  eval `ssh-agent -s`
  ssh-add deploy_key
}

checkTriggerRepo () {
  echo "$TRAVIS_REPO_SLUG $TRIGGER_REPO_SLUG $TRIGGER_REPO_BRANCH"
  if [ "${TRAVIS_REPO_SLUG}" = "${TRIGGER_REPO_SLUG}" ]; then
    echo "This action is running against ${TRIGGER_REPO_SLUG}."
    if [ -z "${TRAVIS_TAG}" -a "${TRAVIS_BRANCH}" != "${TRIGGER_REPO_BRANCH}" ]; then
      echo "This commit was made against ${TRAVIS_BRANCH} and not the ${TRIGGER_REPO_BRANCH} branch. Aborting."
      exit 1
    fi
{'fraction_non_alphanumeric': 0.23836307214895266, 'fraction_numerical': 0.012412723041117145, 'mean_word_length': 4.45137420718816, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1330627', 'n_tokens_mistral': 1956, 'n_tokens_neox': 1813, 'n_words': 423}