<commit_before>#! /bin/sh

# First parameter is build mode, defaults to Debug
MODE=${1:-Debug}

# Find the solution file in the root take it's name
NAME=$(basename $(ls *.sln | head -n 1) .sln)

if [ -x "$(command -v docker)" ]; then
  CONTAINER=$(docker run -d --rm -p 8600:8600 -p 8500:8500 -p 8300:8300 -e CONSUL_BIND_INTERFACE=eth0 consul)
  echo "Started Consul container: $CONTAINER"
  sleep 2
fi

dotnet restore
dotnet build --configuration $MODE

find ./src -iname "*.Tests.csproj" -type f -exec dotnet test --no-build "{}" --configuration $MODE \;

dotnet pack --no-build --configuration $MODE --output ../../.build

if [ -x "$(command -v docker)" ]; then
  docker stop $CONTAINER &> /dev/null
  echo "Removed Consul container"
fi<commit_msg>build: update script to cope with errors, and appveyor paths<commit_after>#! /bin/sh

set -e  # stop on errors

find=/usr/bin/find  # appveyor has find pointing to /c/windows/system32/find for some reason

MODE=${1:-Debug}  # First parameter is build mode, defaults to Debug
NAME=$(basename $(ls *.sln | head -n 1) .sln) # Find the solution file

if [ -x "$(command -v docker)" ]; then
  CONTAINER=$(docker run -d --rm -p 8600:8600 -p 8500:8500 -p 8300:8300 -e CONSUL_BIND_INTERFACE=eth0 consul)
  echo "Started Consul container: $CONTAINER"
  sleep 2
fi

dotnet build \
  --configuration $MODE

find ./src -iname "*.Tests.csproj" | xargs -L1 dotnet test \
  --no-restore \
  --no-build \
  --configuration $MODE \

find ./src -iname "Stronk*.csproj" -not -iname "*.Tests.csproj" | xargs -L1 dotnet pack \
  --no-restore \
  --no-build \
  --configuration $MODE \
  --output ../../.build

if [ -x "$(command -v docker)" ]; then
  docker stop $CONTAINER &> /dev/null
  echo "Removed Consul container"
fi
{'fraction_non_alphanumeric': 0.15231032515687393, 'fraction_numerical': 0.034227039361095266, 'mean_word_length': 3.1173708920187795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2024537', 'n_tokens_mistral': 682, 'n_tokens_neox': 617, 'n_words': 215}