<commit_before>#!/bin/bash

cd `dirname $0`

set -e

read -p "Is this a new project? (y/N) "
if [[ ! $REPLY =~ ^[Yy](es)?$ ]]; then
  read -p "Is this a clone of an existing project? (y/N) "
  if [[ $REPLY =~ ^[Yy](es)?$ ]]; then
    type=clone
    echo -e "\nSet project type to clone."
  else
    echo -e "\nNo project type set, exiting.."
    exit 1
  fi
else
  type=initial
  echo -e "\nSet project type to initial."
fi

#####################
#   GIT/WP/PLUGINS  #
#####################

if [[ $type = "initial" ]]; then

  rm -rf .git
  git init

  read -p "Use git repo other than GitHub for WP? (y/N) "
  if [[ $REPLY =~ ^[Yy](es)?$ ]]; then
    read -p "What is the ssh url of the repo? " url
    sed -i.bak s#git@github.com:WordPress/WordPress.git#$url#g .gitmodules || true
  fi

fi

if [ "$1" != "test" ]; then

  if [[ $type = "initial" ]]; then

    #Initialize Submodules
    git config -f .gitmodules --get-regexp '^submodule\..*\.path$' > tempfile

    while read -u 3 path_key path
      do
        url_key=$(echo $path_key | sed 's/\.path/.url/')
        url=$(git config -f .gitmodules --get "$url_key")
        rm -rf $path; git submodule add $url $path;
        echo "$path has been initialized";
      done 3<tempfile

    rm tempfile

    #Advanced Custom Fields
    curl -LOk http://downloads.wordpress.org/plugin/advanced-custom-fields.zip
    tar -zxvf advanced-custom-fields.zip
    mv advanced-custom-fields public/content/plugins/
    rm -rf advanced-custom-fields.zip

    #WordPress SEO
    yoast=1.5.3.1
    curl -LOk http://downloads.wordpress.org/plugin/wordpress-seo.$yoast.zip
    tar -zxvf wordpress-seo.$yoast.zip wordpress-seo
    mv wordpress-seo public/content/plugins
    rm -rf wordpress-seo.$yoast.zip

  else

    git submodule update --init

  fi

else
  echo -e "\nTesting enabled .. skipped WP & plugin downloads."
fi

#####################
#      CONFIGS      #
#####################

if [[ $type = "initial" ]]; then
  echo -e "\nCreating project wp-config and config.sh"
else
  echo -e "\nCreating config.sh only"<commit_msg>Updating Yoast version<commit_after>#!/bin/bash

cd `dirname $0`

set -e

read -p "Is this a new project? (y/N) "
if [[ ! $REPLY =~ ^[Yy](es)?$ ]]; then
  read -p "Is this a clone of an existing project? (y/N) "
  if [[ $REPLY =~ ^[Yy](es)?$ ]]; then
    type=clone
    echo -e "\nSet project type to clone."
  else
    echo -e "\nNo project type set, exiting.."
    exit 1
  fi
else
  type=initial
  echo -e "\nSet project type to initial."
fi

#####################
#   GIT/WP/PLUGINS  #
#####################

if [[ $type = "initial" ]]; then

  rm -rf .git
  git init

  read -p "Use git repo other than GitHub for WP? (y/N) "
  if [[ $REPLY =~ ^[Yy](es)?$ ]]; then
    read -p "What is the ssh url of the repo? " url
    sed -i.bak s#git@github.com:WordPress/WordPress.git#$url#g .gitmodules || true
  fi

fi

if [ "$1" != "test" ]; then

  if [[ $type = "initial" ]]; then

    #Initialize Submodules
    git config -f .gitmodules --get-regexp '^submodule\..*\.path$' > tempfile

    while read -u 3 path_key path
      do
        url_key=$(echo $path_key | sed 's/\.path/.url/')
        url=$(git config -f .gitmodules --get "$url_key")
        rm -rf $path; git submodule add $url $path;
        echo "$path has been initialized";
      done 3<tempfile

    rm tempfile

    #Advanced Custom Fields
    curl -LOk http://downloads.wordpress.org/plugin/advanced-custom-fields.zip
    tar -zxvf advanced-custom-fields.zip
    mv advanced-custom-fields public/content/plugins/
    rm -rf advanced-custom-fields.zip

    #WordPress SEO
    yoast=1.5.3.2
    curl -LOk http://downloads.wordpress.org/plugin/wordpress-seo.$yoast.zip
    tar -zxvf wordpress-seo.$yoast.zip wordpress-seo
    mv wordpress-seo public/content/plugins
    rm -rf wordpress-seo.$yoast.zip

  else

    git submodule update --init

  fi

else
  echo -e "\nTesting enabled .. skipped WP & plugin downloads."
fi

#####################
#      CONFIGS      #
#####################

if [[ $type = "initial" ]]; then
  echo -e "\nCreating project wp-config and config.sh"
else
  echo -e "\nCreating config.sh only"
{'fraction_non_alphanumeric': 0.1802451333813987, 'fraction_numerical': 0.004325883201153569, 'mean_word_length': 2.6222802436901653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1573265', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1452, 'n_words': 443}