<commit_before>#!/bin/bash -e

REPO_OWNER="holidayextras"
APP_NAME="`cat package.json | grep -m 1 name | cut -d '"' -f 4`"
# Get the last version from Git
git fetch
RELEASED_VERSION_STRING=`git describe --tags `git rev-list --tags --max-count=1` | tr -d "v"`
# Get the version from the local package.json
CANDIDATE_VERSION_STRING="`cat package.json | grep version | cut -d '"' -f 4`"

echo "App Name: $APP_NAME"
echo "Current Release: $RELEASED_VERSION_STRING"
echo "Local Version: $CANDIDATE_VERSION_STRING"

# Split the string up into an array
RELEASED_VERSION=(${RELEASED_VERSION_STRING//./ })
CANDIDATE_VERSION=(${CANDIDATE_VERSION_STRING//./ })

if [ $RELEASED_VERSION = "null" ]; then
	echo "No release to date"
else
	# Check if the major is less than
	if [ ${CANDIDATE_VERSION[0]} -lt ${RELEASED_VERSION[0]} ]; then
		# e.g. 1.0.0 < 2.0.0
		exit 1
	fi
	# Check if the major is less than or equal and if the minor is less than
	if [ ${CANDIDATE_VERSION[0]} -le ${RELEASED_VERSION[0]} ] && [ ${CANDIDATE_VERSION[1]} -lt ${RELEASED_VERSION[1]} ]; then
		# e.g. 1.0.0 < 1.1.0
		exit 1
	fi
	# Check if the major is less than or equal and if the minor is less than or equal and if the patch is less than or equal
	if [ ${CANDIDATE_VERSION[0]} -le ${RELEASED_VERSION[0]} ] && [ ${CANDIDATE_VERSION[1]} -le ${RELEASED_VERSION[1]} ] && [ ${CANDIDATE_VERSION[2]} -le ${RELEASED_VERSION[2]} ]; then
		# e.g. 1.0.0 < 1.0.1
		exit 1
	fi
fi
exit 0<commit_msg>Handle no releases<commit_after>#!/bin/bash -e

REPO_OWNER="holidayextras"
APP_NAME="`cat package.json | grep -m 1 name | cut -d '"' -f 4`"
# Get the last version from Git
git fetch
RELEASED_VERSION_STRING=`git describe --tags \`git rev-list --tags --max-count=1\` | tr -d "v"`
# Get the version from the local package.json
CANDIDATE_VERSION_STRING="`cat package.json | grep version | cut -d '"' -f 4`"

echo "App Name: $APP_NAME"
echo "Current Release: $RELEASED_VERSION_STRING"
echo "Local Version: $CANDIDATE_VERSION_STRING"

# Split the string up into an array
RELEASED_VERSION=(${RELEASED_VERSION_STRING//./ })
CANDIDATE_VERSION=(${CANDIDATE_VERSION_STRING//./ })

if [ -z $RELEASED_VERSION ]; then
	echo "No release to date"
else
	# Check if the major is less than
	if [ ${CANDIDATE_VERSION[0]} -lt ${RELEASED_VERSION[0]} ]; then
		# e.g. 1.0.0 < 2.0.0
		exit 1
	fi
	# Check if the major is less than or equal and if the minor is less than
	if [ ${CANDIDATE_VERSION[0]} -le ${RELEASED_VERSION[0]} ] && [ ${CANDIDATE_VERSION[1]} -lt ${RELEASED_VERSION[1]} ]; then
		# e.g. 1.0.0 < 1.1.0
		exit 1
	fi
	# Check if the major is less than or equal and if the minor is less than or equal and if the patch is less than or equal
	if [ ${CANDIDATE_VERSION[0]} -le ${RELEASED_VERSION[0]} ] && [ ${CANDIDATE_VERSION[1]} -le ${RELEASED_VERSION[1]} ] && [ ${CANDIDATE_VERSION[2]} -le ${RELEASED_VERSION[2]} ]; then
		# e.g. 1.0.0 < 1.0.1
		exit 1
	fi
fi
exit 0
{'fraction_non_alphanumeric': 0.14802065404475043, 'fraction_numerical': 0.026161790017211705, 'mean_word_length': 4.001721170395869, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7354187', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1128, 'n_words': 345}