<commit_before>#!/bin/sh

SVN=`which svn`
SED=`which sed`
if [ "" = "${SED}" ]; then
	echo "This needs sed."
	exit 0;
fi;

SVNREV=`$SVN info | grep Revision`
SVNREV=${SVNREV##*: }

if [ "${1}" = "--pre" ]; then
	# Substitute the version string
	${SED} -r 's/int SVN_REVISION = /int SVN_REVISION = '${SVNREV}'; \/\/ /' ${PWD}/src/com/dmdirc/Main.java > ${PWD}/src/com/dmdirc/Main.java.tmp 2>/dev/null
elif [ "${1}" = "--post" ]; then
	# Unsubstitute the version string
	${SED} -r 's/int SVN_REVISION = .* ([0-9]+);/int SVN_REVISION = \1;/' ${PWD}/src/com/dmdirc/Main.java > ${PWD}/src/com/dmdirc/Main.java.tmp 2>/dev/null
fi;

if [ -e ${PWD}/src/com/dmdirc/Main.java.tmp ]; then
	mv ${PWD}/src/com/dmdirc/Main.java.tmp ${PWD}/src/com/dmdirc/Main.java<commit_msg>AddSVN now works with non-gnu (BSD/OSX) sed<commit_after>#!/bin/sh

SVN=`which svn`
SED=`which sed`
if [ "" = "${SED}" ]; then
	echo "This needs sed."
	exit 0;
fi;

SVNREV=`$SVN info | grep Revision`
SVNREV=${SVNREV##*: }

GNUSED=`sed --version 2>&1 | grep GNU`
if [ "" != "${GNUSED}" ]; then
	PARAM="-r"
else
	PARAM="-E"
fi;

if [ "${1}" = "--pre" ]; then
	# Substitute the version string
	${SED} ${PARAM} 's/int SVN_REVISION = /int SVN_REVISION = '${SVNREV}'; \/\/ /' ${PWD}/src/com/dmdirc/Main.java > ${PWD}/src/com/dmdirc/Main.java.tmp 2>/dev/null
elif [ "${1}" = "--post" ]; then
	# Unsubstitute the version string
	${SED} ${PARAM} 's/int SVN_REVISION = .* ([0-9]+);/int SVN_REVISION = \1;/' ${PWD}/src/com/dmdirc/Main.java > ${PWD}/src/com/dmdirc/Main.java.tmp #2>/dev/null
fi;

if [ -e ${PWD}/src/com/dmdirc/Main.java.tmp ]; then
	mv ${PWD}/src/com/dmdirc/Main.java.tmp ${PWD}/src/com/dmdirc/Main.java
{'fraction_non_alphanumeric': 0.24565608148591972, 'fraction_numerical': 0.01078490113840623, 'mean_word_length': 3.6260387811634347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '6211299', 'n_tokens_mistral': 789, 'n_tokens_neox': 755, 'n_words': 145}