<commit_before># exit with error if we find outstanding changes in repo

echo '** checking git status'

if [ -n "`git status --porcelain`" ]; then
echo "Outstanding changes in repo!"
echo
git status
exit 1
fi

DIR=`dirname $0`
TARGET=${DIR}/public

if [ -d  ] ; then
  echo
  echo '** removing previous public folder'
  rm -rf ${TARGET}
fi

echo
echo '** building with gatsby'

gatsby build

echo
echo '** compressing files'

find ./public | grep -v \.gz$ | while read FILE;
do
  if [ -f "${FILE}" -a ! -f "${FILE}.gz" ] ; then
    echo "${FILE}"
    gzip -c -- "${FILE}" > "${FILE}.gz"
  fi
done<commit_msg>build.sh: set -e, delete contents of dist/ not dir<commit_after>set -e

echo '** checking git status'

if [ -n "`git status --porcelain`" ]; then
echo "Outstanding changes in repo!"
echo
git status
exit 1
fi

DIR=`dirname $0`
TARGET=${DIR}/public

if [ -d "${TARGET}" ] ; then
  echo
  echo '** removing previous public folder'
  pushd ${TARGET} > /dev/null
  rm -rf *
  popd > /dev/null
fi

echo
echo '** building with gatsby'

gatsby build

echo
echo '** compressing files'

find ./public | grep -v \.gz$ | while read FILE;
do
  if [ -f "${FILE}" -a ! -f "${FILE}.gz" ] ; then
    echo "${FILE}"
    gzip -c -- "${FILE}" > "${FILE}.gz"
  fi
done
{'fraction_non_alphanumeric': 0.16812749003984065, 'fraction_numerical': 0.0031872509960159364, 'mean_word_length': 3.0647249190938513, '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': '3324629', 'n_tokens_mistral': 456, 'n_tokens_neox': 447, 'n_words': 169}