<commit_before>#!/bin/bash

versionPattern="[0-9]+\.[0-9]+\.[0-9]+(\-beta)*"

tagName=""
while [[ ! $tagName =~ $versionPattern ]]; do
  read -p "Tag name (version): " tagName
done


if ! grep -Fq "<version>$tagName</version>" ./pom.xml; then
  echo -e "$(tput setaf 1)WOW, wait! The provided tag does not match the pom.xml version$(tput sgr0)"
  exit 1
fi
if ! grep -Fq "JOAL_VERSION=\"$tagName\"" ./Dockerfile; then
  echo -e "$(tput setaf 1)WOW, wait! The provided tag does not match the Dockerfile version$(tput sgr0)"
  exit 1
fi
if ! grep -Fq "JOAL_VERSION=\"$tagName\"" ./Dockerfile.arm; then
  echo -e "$(tput setaf 1)WOW, wait! The provided tag does not match the Dockerfile.arm version$(tput sgr0)"
  exit 1
fi

# REDEFINE THE TAG NAME (prefixed with 'v')
tagName=v$tagName

if GIT_DIR=./.git git rev-parse $tagName >/dev/null 2>&1
then
    echo -e "$(tput setaf 1)ERROR: Tag $tagName already exists$(tput sgr0)"
fi

if git tag $tagName; then
  echo -e "$(tput setaf 2)Tag created$(tput sgr0)"
else
  echo -e "$(tput setaf 1)ERROR: Failed to create tag locally$(tput sgr0)"
  exit 1
fi

if git push origin $tagName; then
  echo -e "$(tput setaf 2)Tag pushed$(tput sgr0)"<commit_msg>Fix publish script<commit_after>#!/bin/bash

versionPattern="[0-9]+\.[0-9]+\.[0-9]+(\-beta)*"

tagName=""
while [[ ! $tagName =~ $versionPattern ]]; do
  read -p "Tag name (version): " tagName
done


if ! grep -Fq "<version>$tagName</version>" ./pom.xml; then
  echo -e "$(tput setaf 1)WOW, wait! The provided tag does not match the pom.xml version$(tput sgr0)"
  exit 1
fi
if ! grep -Fq "JOAL_VERSION=\"$tagName\"" ./Dockerfile; then
  echo -e "$(tput setaf 1)WOW, wait! The provided tag does not match the Dockerfile version$(tput sgr0)"
  exit 1
fi
if ! grep -Fq "JOAL_VERSION=\"$tagName\"" ./Dockerfile.arm32v7; then
  echo -e "$(tput setaf 1)WOW, wait! The provided tag does not match the Dockerfile.arm32v7 version$(tput sgr0)"
  exit 1
fi

# REDEFINE THE TAG NAME (prefixed with 'v')
tagName=v$tagName

if GIT_DIR=./.git git rev-parse $tagName >/dev/null 2>&1
then
    echo -e "$(tput setaf 1)ERROR: Tag $tagName already exists$(tput sgr0)"
fi

if git tag $tagName; then
  echo -e "$(tput setaf 2)Tag created$(tput sgr0)"
else
  echo -e "$(tput setaf 1)ERROR: Failed to create tag locally$(tput sgr0)"
  exit 1
fi

if git push origin $tagName; then
  echo -e "$(tput setaf 2)Tag pushed$(tput sgr0)"
{'fraction_non_alphanumeric': 0.15602836879432624, 'fraction_numerical': 0.024196912807676264, 'mean_word_length': 3.9443298969072167, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4244630', 'n_tokens_mistral': 973, 'n_tokens_neox': 908, 'n_words': 313}