<commit_before>#!/usr/bin/env bash

CURRENT_DIR=$(pwd)
SETUP_FILENAME="setup.py"
CONNECTOR_NAME_REGEXP="^google-datacatalog-([a-zA-Z]+)-connector$"

create-current-version-tags::main(){

    if [[ -z "${GITHUB_TOKEN}" ]]; then
        create-current-version-tags::usage
    fi

    echo "START current version tagging script"
    echo ""

    for connector_dir in `ls ${CURRENT_DIR} | grep connector`; do
        echo " running on: ${connector_dir}"

        setup_path=${CURRENT_DIR}/${connector_dir}/${SETUP_FILENAME}

        current_version=$(sed -n "s/^ *version=['\'']//p" ${setup_path} | sed -n "s/['\'',]*$//p")

        [[ ${connector_dir} =~ ${CONNECTOR_NAME_REGEXP} ]]
        connector_simple_name="${BASH_REMATCH[1]}"

        echo " tagging ${connector_simple_name} with current version: ${current_version}"

        tag_name="${connector_simple_name}-${current_version}"

        git tag ${tag_name}

        if [[ $? -eq 0 ]]
            then
                echo " tag: ${tag_name} created"
                git_remote_url="$(git remote get-url origin).git"
                git_auth_remote_url="${git_remote_url/github.com/${GITHUB_TOKEN}@github.com}"
                git push ${git_auth_remote_url} ${tag_name}
                echo " tag: ${tag_name} pushed!"
            else
                echo " tag: ${tag_name} failed!"
        fi

        echo ""<commit_msg>FIX remove suffix from script (#40)<commit_after>#!/usr/bin/env bash

CURRENT_DIR=$(pwd)
SETUP_FILENAME="setup.py"
CONNECTOR_NAME_REGEXP="^google-datacatalog-([a-zA-Z]+)-connector$"

create-current-version-tags::main(){

    if [[ -z "${GITHUB_TOKEN}" ]]; then
        create-current-version-tags::usage
    fi

    echo "START current version tagging script"
    echo ""

    for connector_dir in `ls ${CURRENT_DIR} | grep connector`; do
        echo " running on: ${connector_dir}"

        setup_path=${CURRENT_DIR}/${connector_dir}/${SETUP_FILENAME}

        current_version=$(sed -n "s/^ *version=['\'']//p" ${setup_path} | sed -n "s/['\'',]*$//p")

        [[ ${connector_dir} =~ ${CONNECTOR_NAME_REGEXP} ]]
        connector_simple_name="${BASH_REMATCH[1]}"

        echo " tagging ${connector_simple_name} with current version: ${current_version}"

        tag_name="${connector_simple_name}-${current_version}"

        git tag ${tag_name}

        if [[ $? -eq 0 ]]
            then
                echo " tag: ${tag_name} created"
                git_remote_url="$(git remote get-url origin)"
                git_auth_remote_url="${git_remote_url/github.com/${GITHUB_TOKEN}@github.com}"
                git push ${git_auth_remote_url} ${tag_name}
                echo " tag: ${tag_name} pushed!"
            else
                echo " tag: ${tag_name} failed!"
        fi

        echo ""
{'fraction_non_alphanumeric': 0.15959741193386054, 'fraction_numerical': 0.002156721782890007, 'mean_word_length': 2.609597924773022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2348383', 'n_tokens_mistral': 928, 'n_tokens_neox': 870, 'n_words': 169}