<commit_before>#!/bin/bash

THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

CONFIG_tmp_script_file_path="${THIS_SCRIPT_DIR}/._script_cont"

set -e

if [ -z "${GENERIC_SCRIPT_RUNNER_CONTENT}" ] ; then
	echo " [!] => Failed: No script (content) defined for execution!"
	exit 1
fi

if [ -z "${GENERIC_SCRIPT_RUNNER_BIN}" ] ; then
	echo " [!] => Failed: No script executor defined!"
	exit 1
fi

echo
echo "==> Start"

if [ ! -z "${GENERIC_SCRIPT_RUNNER_WORKING_DIR}" ] ; then
	echo "==> Switching to working directory: ${GENERIC_SCRIPT_RUNNER_WORKING_DIR}"
	cd "${GENERIC_SCRIPT_RUNNER_WORKING_DIR}"
fi

if [ ! -z "${GENERIC_SCRIPT_RUNNER_SCRIPT_TMP_PATH}" ] ; then
	echo "-> Script (tmp) save path specified: ${GENERIC_SCRIPT_RUNNER_SCRIPT_TMP_PATH}"
	CONFIG_tmp_script_file_path="${GENERIC_SCRIPT_RUNNER_SCRIPT_TMP_PATH}"
fi

echo "${GENERIC_SCRIPT_RUNNER_CONTENT}" > "${CONFIG_tmp_script_file_path}"

set +e
${GENERIC_SCRIPT_RUNNER_BIN} "${CONFIG_tmp_script_file_path}"
script_result=$?
set -e

rm "${CONFIG_tmp_script_file_path}"
exit ${script_result}<commit_msg>minor log changes<commit_after>#!/bin/bash

THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

CONFIG_tmp_script_file_path="${THIS_SCRIPT_DIR}/._script_cont"

set -e

if [ -z "${GENERIC_SCRIPT_RUNNER_CONTENT}" ] ; then
	echo " [!] => Failed: No script (content) defined for execution!"
	exit 1
fi

if [ -z "${GENERIC_SCRIPT_RUNNER_BIN}" ] ; then
	echo " [!] => Failed: No script executor defined!"
	exit 1
fi

echo
echo "==> Start"

if [ ! -z "${GENERIC_SCRIPT_RUNNER_WORKING_DIR}" ] ; then
	echo "==> Switching to working directory: ${GENERIC_SCRIPT_RUNNER_WORKING_DIR}"
	cd "${GENERIC_SCRIPT_RUNNER_WORKING_DIR}"
fi

if [ ! -z "${GENERIC_SCRIPT_RUNNER_SCRIPT_TMP_PATH}" ] ; then
	echo "==> Script (tmp) save path specified: ${GENERIC_SCRIPT_RUNNER_SCRIPT_TMP_PATH}"
	CONFIG_tmp_script_file_path="${GENERIC_SCRIPT_RUNNER_SCRIPT_TMP_PATH}"
fi

echo "${GENERIC_SCRIPT_RUNNER_CONTENT}" > "${CONFIG_tmp_script_file_path}"

set +e
${GENERIC_SCRIPT_RUNNER_BIN} "${CONFIG_tmp_script_file_path}"
script_result=$?
set -e

echo
echo " (i) Script exit code: ${script_result}"
echo

rm "${CONFIG_tmp_script_file_path}"
exit ${script_result}
{'fraction_non_alphanumeric': 0.14836396234872254, 'fraction_numerical': 0.002689376961004034, 'mean_word_length': 6.804195804195804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1926957', 'n_tokens_mistral': 911, 'n_tokens_neox': 860, 'n_words': 169}