<commit_before>#!/usr/bin/env bash
# File checked with ShellCheck (https://www.shellcheck.net/)

#/ Initialization script for Kurento documentation.
#/
#/ This shell script prepares the sources for building. The main work done here
#/ is replacing all |PLACEHOLDER| variables with their actual values, as defined
#/ in `VERSIONS.env`.
#/
#/ Arguments: None.



# Shell setup
# ===========

# Shell options for strict error checking
set -o errexit -o errtrace -o pipefail -o nounset

# Help message (extracted from script headers)
usage() {
    grep '^#/' "$0" | cut --characters=4-
    exit 0
}
REGEX='^(-h|--help)$'
if [[ "${1:-}" =~ $REGEX ]]; then
    usage
fi

# Log function
BASENAME="$(basename "$0")"  # Complete file name
log() { echo "[$BASENAME] $*"; }



# Load VERSIONS file
# ==================

BASEPATH="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"  # Absolute canonical path

CONF_FILE="$BASEPATH/VERSIONS.env"

[[ -f "$CONF_FILE" ]] || {
    log "ERROR: Shell config file not found: $CONF_FILE"
    exit 1
}

# shellcheck source=VERSIONS.env
source "$CONF_FILE"



# Replace placeholders
# ====================
<commit_msg>configure.sh: Update with same code than adm-scripts/bash.conf.sh<commit_after>#!/usr/bin/env bash
#Checked with ShellCheck (https://www.shellcheck.net/)

#/ Initialization script for Kurento documentation.
#/
#/ This shell script prepares the sources for building. The main work done here
#/ is replacing all |PLACEHOLDER| variables with their actual values, as defined
#/ in `VERSIONS.env`.
#/
#/ Arguments: None.



# Shell setup
# ===========

# Bash options for strict error checking.
set -o errexit -o errtrace -o pipefail -o nounset
shopt -s inherit_errexit 2>/dev/null || true

# Trace all commands (to stderr).
#set -o xtrace

# Help message.
# Extracts and prints text from special comments in the script header.
function usage { grep '^#/' "${BASH_SOURCE[-1]}" | cut -c 4-; exit 0; }
if [[ "${1:-}" =~ ^(-h|--help)$ ]]; then usage; fi

# Log function.
BASENAME="$(basename "$0")"  # Complete file name
log() { echo "[$BASENAME] $*"; }



# Load VERSIONS file
# ==================

BASEPATH="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"  # Absolute canonical path

CONF_FILE="$BASEPATH/VERSIONS.env"

[[ -f "$CONF_FILE" ]] || {
    log "ERROR: Shell config file not found: $CONF_FILE"
    exit 1
}

# shellcheck source=VERSIONS.env
source "$CONF_FILE"



# Replace placeholders
# ====================

{'fraction_non_alphanumeric': 0.1906900775826868, 'fraction_numerical': 0.006124948958758677, 'mean_word_length': 3.78515625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1487718', 'n_tokens_mistral': 848, 'n_tokens_neox': 795, 'n_words': 262}