<commit_before>#!/bin/bash
TOOLDIR=$(dirname $(dirname $0))
WORKDIR=$(pwd)/work

usage () {
    cat <<EOF
Usage: ./setup-dev-whelk.sh -n <NAME> -O <OAIPMH CREDENTIALS> [-D <DATABASE USER>] [-C <CREATEDB USER>]

    -n, --whelk-name
        Instance name. Used as database name and ElasticSearch index.

    -O, --oaipmh-credentials
        Credentials for OAIPMH. On the form "<USER>:<PASSWORD>".

    -D, --db-user
        PostgreSQL database user.

        If unset, no username will be explicitly supplied to PostgreSQL.

    -C, --createdb-user
        User to run 'createdb' as ('sudo -u <CREATEDB USER> createdb ...').

        If unset, runs 'createdb' without 'sudo'.

    -F, --force-rebuild
        If set, rebuild virtualenvs, definitions, OAIPMH files, and JAR files
EOF<commit_msg>Make setup-dev-whelk.sh break on failure<commit_after>#!/bin/bash
set -e

TOOLDIR=$(dirname $(dirname $0))
WORKDIR=$(pwd)/work

usage () {
    cat <<EOF
Usage: ./setup-dev-whelk.sh -n <NAME> -O <OAIPMH CREDENTIALS> [-D <DATABASE USER>] [-C <CREATEDB USER>]

    -n, --whelk-name
        Instance name. Used as database name and ElasticSearch index.

    -O, --oaipmh-credentials
        Credentials for OAIPMH. On the form "<USER>:<PASSWORD>".

    -D, --db-user
        PostgreSQL database user.

        If unset, no username will be explicitly supplied to PostgreSQL.

    -C, --createdb-user
        User to run 'createdb' as ('sudo -u <CREATEDB USER> createdb ...').

        If unset, runs 'createdb' without 'sudo'.

    -F, --force-rebuild
        If set, rebuild virtualenvs, definitions, OAIPMH files, and JAR files
EOF
{'fraction_non_alphanumeric': 0.1367837338262477, 'fraction_numerical': 0.0012322858903265558, 'mean_word_length': 2.5770925110132157, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, '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': '2354244', 'n_tokens_mistral': 579, 'n_tokens_neox': 538, 'n_words': 179}