<commit_before>dir=(`pwd`)
step=1
start=1
end=100
build_target="<EMAIL>:/u/apps/communitylands/current/public/system/builds"
win=0
mac=0

while [[ "$1" != "" ]]; do
  case $1 in
    -s | --start )
      shift
      start=$1
      ;;
    -e | --end )
      shift
      end=$1
      ;;
    --no-upload )
      end=5
      ;;
    -t | --target )
      shift
      build_target=$1
      ;;
    --mac )
      win=1
      mac=0
      ;;
    --win )
      win=0
      mac=1
      ;;
    * )
      ;;
  esac
  shift
done

echo "# Building Community Lands Monitoring Station from $dir"

if [ $step -ge $start -a $step -le $end ]
then
  echo "1) Updating MapFilter..."
  cd ../mapfilter
  git checkout fileodk
  if [[ "$?" != 0 ]]
  then
    echo "Failed to checkout mapfilter branch 'fileodk'; perhaps there are conflicts. Fix this first, then re-run build script"
    exit
  fi
  git pull

  if [[ "$?" != 0 ]]
  then
    echo "Failed to execute git pull on mapfilter; perhaps there are conflicts. Fix this first, then re-run build script"
    exit
  fi
  cd $dir
fi

((step++))

if [ $step -ge $start -a $step -le $end ]
then
  echo "2) Updating Monitoring Station"
  git checkout master
  git pull
  if [ "$?" != 0 ]
  then
    echo "Failed to execute git pull on monitoring-station; perhaps there are conflicts. Fix this first, then re-run build script"
    exit
  fi
fi

((step++))

if [ $step -ge $start -a $step -le $end ]
then
  echo "3) Building MapFilter..."
  cd ../mapfilter
  npm run build:web && cp dist/* $dir/mapfilter/
  cd $dir
fi


((step++))

if [ $step -ge $start -a $step -le $end ]
then
  git log -n 1 --format='{ "version": "%h" }' > application/data/version.json

  echo "4) Creating builds for:"
  rm -rf builds
  if [ $win == 0 ]
  then
    echo " ----- Windows -----"<commit_msg>Update build script with necessary installations<commit_after>dir=(`pwd`)
step=1
start=1
end=100
build_target="<EMAIL>:/u/apps/communitylands/current/public/system/builds"
win=0
mac=0

while [[ "$1" != "" ]]; do
  case $1 in
    -s | --start )
      shift
      start=$1
      ;;
    -e | --end )
      shift
      end=$1
      ;;
    --no-upload )
      end=5
      ;;
    -t | --target )
      shift
      build_target=$1
      ;;
    --mac )
      win=1
      mac=0
      ;;
    --win )
      win=0
      mac=1
      ;;
    * )
      ;;
  esac
  shift
done

echo "# Cleaning out tiles"
rm Monitoring/Maps/Bing/*.jpeg

echo "# Installing dependencies if needed"
npm install

echo "# Building Community Lands Monitoring Station from $dir"

if [ $step -ge $start -a $step -le $end ]
then
  echo "1) Updating MapFilter..."
  cd ../mapfilter
  git checkout fileodk
  if [[ "$?" != 0 ]]
  then
    echo "Failed to checkout mapfilter branch 'fileodk'; perhaps there are conflicts. Fix this first, then re-run build script"
    exit
  fi
  git pull

  if [[ "$?" != 0 ]]
  then
    echo "Failed to execute git pull on mapfilter; perhaps there are conflicts. Fix this first, then re-run build script"
    exit
  fi
  cd $dir
fi

((step++))

if [ $step -ge $start -a $step -le $end ]
then
  echo "2) Updating Monitoring Station"
  git checkout master
  git pull
  if [ "$?" != 0 ]
  then
    echo "Failed to execute git pull on monitoring-station; perhaps there are conflicts. Fix this first, then re-run build script"
    exit
  fi
fi

((step++))

if [ $step -ge $start -a $step -le $end ]
then
  echo "3) Building MapFilter..."
  cd ../mapfilter
  sh install-dependencies.sh
  npm run build:web && cp dist/* $dir/mapfilter/
  cd $dir
fi


((step++))

if [ $step -ge $start -a $step -le $end ]
then
  git log -n 1 --format='{ "version": "%h" }' > application/data/version.json

  echo "4) Creating builds for:"
  rm -rf builds
  if [ $win == 0 ]
  then
    echo " ----- Windows -----"
{'fraction_non_alphanumeric': 0.14592161016949154, 'fraction_numerical': 0.013771186440677966, 'mean_word_length': 2.1927303465765005, 'pattern_counts': {'":': 2, '<': 5, '<?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': '2521220', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1297, 'n_words': 452}