<commit_before>#!/usr/bin/env bash
set -eo pipefail

UPDATE_STATUS_PATH=$1
BUILDKITE_PULL_REQUEST=$2
BUILDKITE_BUILD_URL=$3

if [[ -z "${UPDATE_STATUS_PATH}" || -z "${BUILDKITE_PULL_REQUEST}" || -z "${BUILDKITE_BUILD_URL}" ]] ; then
    echo "Update status path (${UPDATE_STATUS_PATH}), pull request (${BUILDKITE_BUILD_URL}) or build url (${BUILDKITE_PULL_REQUEST}) unset."
    trap - EXIT
    exit 255
fi

trapped="false"
function trap_handler() {
    if [[ "$trapped" = "false" ]]; then
        ${UPDATE_STATUS_PATH} "pinterest" "PINRemoteImage" "${BUILDKIT_PULL_REQUEST}" "failure" "${BUILDKITE_BUILD_URL}" "Tests failed." "CI/Pinterest"
        echo "Tests failed, updated status to failure"
    fi
    trapped="true"
}
trap trap_handler INT TERM EXIT

./build.sh all

${UPDATE_STATUS_PATH} "pinterest" "PINRemoteImage" ${BUILDKIT_PULL_REQUEST} "success" ${BUILDKITE_BUILD_URL} "Tests passed." "CI/Pinterest"
echo "All tests succeeded, updated status to success"
trap - EXIT
exit 0<commit_msg>Actually spell var correctly…<commit_after>#!/usr/bin/env bash
set -eo pipefail

UPDATE_STATUS_PATH=$1
BUILDKITE_PULL_REQUEST=$2
BUILDKITE_BUILD_URL=$3

if [[ -z "${UPDATE_STATUS_PATH}" || -z "${BUILDKITE_PULL_REQUEST}" || -z "${BUILDKITE_BUILD_URL}" ]] ; then
    echo "Update status path (${UPDATE_STATUS_PATH}), pull request (${BUILDKITE_BUILD_URL}) or build url (${BUILDKITE_PULL_REQUEST}) unset."
    trap - EXIT
    exit 255
fi

trapped="false"
function trap_handler() {
    if [[ "$trapped" = "false" ]]; then
        ${UPDATE_STATUS_PATH} "pinterest" "PINRemoteImage" "${BUILDKITE_PULL_REQUEST}" "failure" "${BUILDKITE_BUILD_URL}" "Tests failed." "CI/Pinterest"
        echo "Tests failed, updated status to failure"
    fi
    trapped="true"
}
trap trap_handler INT TERM EXIT

${UPDATE_STATUS_PATH} "pinterest" "PINRemoteImage" ${BUILDKITE_PULL_REQUEST} "pending" ${BUILDKITE_BUILD_URL} "Starting build…" "CI/Pinterest"

./build.sh all

${UPDATE_STATUS_PATH} "pinterest" "PINRemoteImage" ${BUILDKITE_PULL_REQUEST} "success" ${BUILDKITE_BUILD_URL} "Tests passed." "CI/Pinterest"
echo "All tests succeeded, updated status to success"
trap - EXIT
exit 0
{'fraction_non_alphanumeric': 0.1391465677179963, 'fraction_numerical': 0.006493506493506494, 'mean_word_length': 5.438805970149254, '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': '6407605', 'n_tokens_mistral': 754, 'n_tokens_neox': 743, 'n_words': 185}