<commit_before>#!/usr/bin/env bash
#
# WPLib Box provision script
#

#
# Import default database from /sql/default.sql
#

mysql -u root wordpress < /vagrant/sql/default.sql

#
# Symlink the Object Cache Drop-in for Redis, if not already symlinked
#
content_dir="/var/www/content"
cache_file="${content_dir}/mu-plugins/wp-redis/object-cache.php"
cache_link="${content_dir}/object-cache.php"
if [ ! -f "${cache_file}" ]; then
    echo "ERROR: Composer not run before Vagrant. Please run these two (2) commands:"
    echo " "
    echo "      composer install"
    echo "      vagrant reload --provision"
    echo " "
else
    sudo ln -sf "${cache_file}" "${cache_link}"
fi
echo "Creating sites"
while read -r host
do
  host=${host/./-}
#  mkdir -p "/var/www/${host}/content"
#  mkdir -p "/var/www/${host}/content/plugins"
#  mkdir -p "/var/www/${host}/content/themes"
#  mkdir -p "/var/www/${host}/content/mu-plugins"
  host=${host/-/_}
  mysql -u root -e "CREATE DATABASE IF NOT EXISTS ${host}"
  mysql -u root -e "GRANT ALL PRIVILEGES ON ${host}.* TO wordpress@localhost IDENTIFIED BY 'wordpress';"
  mysql -u root ${host} < /vagrant/sql/default.sql
done < '/var/www/.hosts'<commit_msg>add hosts support to provisions<commit_after>#!/usr/bin/env bash
#
# WPLib Box provision script
#

#
# Import default database from /sql/default.sql
#

mysql -u root wordpress < /vagrant/sql/default.sql

#
# Symlink the Object Cache Drop-in for Redis, if not already symlinked
#
content_dir="/var/www/content"
cache_file="${content_dir}/mu-plugins/wp-redis/object-cache.php"
cache_link="${content_dir}/object-cache.php"
if [ ! -f "${cache_file}" ]; then
    echo "ERROR: Composer not run before Vagrant. Please run these two (2) commands:"
    echo " "
    echo "      composer install"
    echo "      vagrant reload --provision"
    echo " "
else
    sudo ln -sf "${cache_file}" "${cache_link}"
fi
echo "Creating sites"
while read -r host
do
  host=${host/./-}
  mkdir -p "/var/www/${host}/content"
  mkdir -p "/var/www/${host}/content/plugins"
  mkdir -p "/var/www/${host}/content/themes"
  mkdir -p "/var/www/${host}/content/mu-plugins"
  host=${host/-/_}
  mysql -u root -e "CREATE DATABASE IF NOT EXISTS ${host}"
  mysql -u root -e "GRANT ALL PRIVILEGES ON ${host}.* TO wordpress@localhost IDENTIFIED BY 'wordpress';"
  mysql -u root ${host} < /vagrant/sql/default.sql
done < '/var/www/.hosts'
{'fraction_non_alphanumeric': 0.16275167785234898, 'fraction_numerical': 0.0008389261744966443, 'mean_word_length': 3.424860853432282, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, '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': '6192881', 'n_tokens_mistral': 855, 'n_tokens_neox': 834, 'n_words': 235}