<commit_before>#!/bin/bash -e

change_env_value() {
    local _variable="${1}"
    local _value="${2}"

    awk -F '=' '/^export '"${_variable}"'=.+/ { print $1 "='"${_value}"'"; getline; } { print; }' yaul.env > yaul.env.tmp
    mv yaul.env.tmp yaul.env
}

for var in "BUILD_TYPE" "YAUL_INSTALL_ROOT" "YAUL_BUILD_ROOT" "YAUL_BUILD" "YAUL_OPTION_DEV_CARTRIDGE"; do
    if ! set 2>&1 | grep -q -E "^${var}=.+$"; then
        printf -- "Environment variable \`${var}' was not set\n"
        exit 1
    fi
done

pwd

set -x

cp yaul.env.in yaul.env
change_env_value "YAUL_INSTALL_ROOT" "${YAUL_INSTALL_ROOT}"
change_env_value "YAUL_BUILD_ROOT" "${YAUL_BUILD_ROOT}"
change_env_value "YAUL_BUILD" "${YAUL_BUILD}"
change_env_value "YAUL_OPTION_DEV_CARTRIDGE" "${YAUL_OPTION_DEV_CARTRIDGE}"

. ./yaul.env

make ${BUILD_TYPE}
make install-${BUILD_TYPE}
<commit_msg>Update .travis.yml<commit_after>#!/bin/bash -e

change_env_value() {
    local _variable="${1}"
    local _value="${2}"

    awk -F '=' '/^export '"${_variable}"'=.+/ { print $1 "='"${_value}"'"; getline; } { print; }' yaul.env > yaul.env.tmp
    mv yaul.env.tmp yaul.env
}

for var in "BUILD_TYPE" "YAUL_INSTALL_ROOT" "YAUL_BUILD_ROOT" "YAUL_BUILD" "YAUL_OPTION_DEV_CARTRIDGE"; do
    if ! set 2>&1 | grep -q -E "^${var}=.+$"; then
        printf -- "Environment variable \`${var}' was not set\n"
        exit 1
    fi
done

pwd

set -x

cp yaul.env.in yaul.env
change_env_value "YAUL_INSTALL_ROOT" "${YAUL_INSTALL_ROOT}"
change_env_value "YAUL_BUILD_ROOT" "${YAUL_BUILD_ROOT}"
change_env_value "YAUL_BUILD" "${YAUL_BUILD}"
change_env_value "YAUL_OPTION_DEV_CARTRIDGE" "${YAUL_OPTION_DEV_CARTRIDGE}"

. ./yaul.env

make ${BUILD_TYPE}
sudo make install-${BUILD_TYPE}

{'fraction_non_alphanumeric': 0.1751740139211137, 'fraction_numerical': 0.0069605568445475635, 'mean_word_length': 4.275229357798165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3896860', 'n_tokens_mistral': 753, 'n_tokens_neox': 699, 'n_words': 146}