<commit_before>info() {
    if [ -n "$RELAY_DEBUG" ]
    then
        echo "$@" >&2
    fi
}

info
info

while [ $# -gt 0 ]
do
    case $1 in
        --build-dir)
            BUILD_DIR=$2
            shift 2
            ;;
        --command-file)
            CMD_FILE=$2
            shift 2
            ;;
        --target)
            TARGET=$2
            shift 2
            ;;
        --prerequisites)
            shift 1
            while [ $# -gt 0 ]
            do
                case $1 in
                    --)
                        shift 1
                        break
                        ;;
                    *)
                        PREREQS="$PREREQS $1"
                        shift 1
                        ;;
                esac
            done
            ;;
        --phony)
            shift 1
            PHONY=True
            ;;
        *)
            break
            ;;
    esac
done
info Making "$TARGET" with command "$@", with updated prereqs "$PREREQS",\
 putting command into "$CMD_FILE", build dir is "$BUILD_DIR"

if [ "$PHONY" = "True" ]
then
    info We\'re building phony target
fi

CMD="$@"
if [ ! -z $CMD_FILE ]
then
    mkdir -p $(dirname $CMD_FILE)
    echo "$CMD" > $CMD_FILE
fi
if [ ! -z $TARGET ]
then
    info Creating directory $(dirname $TARGET) 'for' $TARGET
    mkdir -p $(dirname $TARGET)
fi

info Resulting CMD: "$CMD"
<commit_msg>Add directory creation logging<commit_after>info() {
    if [ -n "$RELAY_DEBUG" ]
    then
        echo "$@" >&2
    fi
}

info
info

while [ $# -gt 0 ]
do
    case $1 in
        --build-dir)
            BUILD_DIR=$2
            shift 2
            ;;
        --command-file)
            CMD_FILE=$2
            shift 2
            ;;
        --target)
            TARGET=$2
            shift 2
            ;;
        --prerequisites)
            shift 1
            while [ $# -gt 0 ]
            do
                case $1 in
                    --)
                        shift 1
                        break
                        ;;
                    *)
                        PREREQS="$PREREQS $1"
                        shift 1
                        ;;
                esac
            done
            ;;
        --phony)
            shift 1
            PHONY=True
            ;;
        *)
            break
            ;;
    esac
done
info Making "$TARGET" with command "$@", with updated prereqs "$PREREQS",\
 putting command into "$CMD_FILE", build dir is "$BUILD_DIR"

if [ "$PHONY" = "True" ]
then
    info We\'re building phony target
fi

CMD="$@"
if [ ! -z $CMD_FILE ]
then
    mkdir -p $(dirname $CMD_FILE)
    echo "$CMD" > $CMD_FILE
fi
if [ ! -z $TARGET ] && [ ! -d $(dirname $TARGET) ]
then
    echo MKDIR $(dirname $TARGET)
    mkdir -p $(dirname $TARGET)
fi

info Resulting CMD: "$CMD"

{'fraction_non_alphanumeric': 0.11190053285968028, 'fraction_numerical': 0.011367673179396092, 'mean_word_length': 0.9514899514899515, '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': '1704173', 'n_tokens_mistral': 872, 'n_tokens_neox': 791, 'n_words': 233}