<commit_before>#!/bin/bash

STATUS=$1
DEST=$2
URI=$3
RESULT=$4

if [ $# -lt 3 ]; then
    echo "`basename $0` [SUCCESS|ERROR] DESTINATION URI [RESULT]"
    echo "`basename $0` SUCCESS <EMAIL> http://www.w3.org/TR/YYYY/WD-shortname-YYYYMMDD"
    exit 1
fi

if [ "SUCCESS" == "$STATUS" ]; then
    SUBJECT="[W3C Publication] $URI had been published on http://www.w3.org/TR/"
    BODY="On `date -u`, $URI has been published by the W3C automated publication system.

If you believe there's an error, please contact <EMAIL>."
elif [ "ERROR" == "$STATUS" ]; then
    SUBJECT="[W3C Publication] Publication of $URI failed"
    BODY="On `date -u`, the request to publish $URI failed. See details below.

$RESULT"
fi

if [ ! -z "$SUBJECT" -a ! -z "$BODY" ]; then
    mail -aFrom:<EMAIL> -s "$SUBJECT" $DEST <<< "$BODY"
fi
<commit_msg>Only send mails when in production<commit_after>#!/bin/bash

STATUS=$1
DEST=$2
URI=$3
RESULT=$4

if [ $# -lt 3 ]; then
    echo "`basename $0` [SUCCESS|ERROR] DESTINATION URI [RESULT]"
    echo "`basename $0` SUCCESS <EMAIL> http://www.w3.org/TR/YYYY/WD-shortname-YYYYMMDD"
    exit 1
fi

if [ "SUCCESS" == "$STATUS" ]; then
    SUBJECT="[W3C Publication] $URI had been published on http://www.w3.org/TR/"
    BODY="On `date -u`, $URI has been published by the W3C automated publication system.

If you believe there's an error, please contact <EMAIL>."
elif [ "ERROR" == "$STATUS" ]; then
    SUBJECT="[W3C Publication] Publication of $URI failed"
    BODY="On `date -u`, the request to publish $URI failed. See details below.

$RESULT"
fi

if [ "$NODE_ENV" == "production" -a ! -z "$SUBJECT" -a ! -z "$BODY" ]; then
    mail -aFrom:<EMAIL> -s "$SUBJECT" $DEST <<< "$BODY"
fi

{'fraction_non_alphanumeric': 0.17038777908343125, 'fraction_numerical': 0.01527614571092832, 'mean_word_length': 3.6403269754768393, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5538782', 'n_tokens_mistral': 654, 'n_tokens_neox': 623, 'n_words': 202}