<commit_before>#!/bin/bash
if [ -f .env ]; then
  source .env
elif [[ -f ../.env ]]; then
  source ../.env
fi

set -e
DIR_NAME=${PWD##*/}

if [[ $DIR_NAME != 'static' ]] && [[ `ls -A ./static` ]]; then
  cd ./static
elif [[ $DIR_NAME == 'static' ]]; then
  cd .
else
  exit
fi
DIR_NAME=${PWD##*/}

gulp production

if [[ $DIR_NAME == 'static' ]]; then
  cd ..
fi

set +e
git stash
set -e

git checkout --orphan gh-pages
cp -Rf ./static/builds/production/. ./
git rm -rf wordpress
git rm -rf static
git rm -rf exports
git rm -f .gitignore
git rm -f .env
git rm -f README.md
git rm -f wp-cli.local.yml

echo ".idea" > .gitignore
echo "static" >> .gitignore
echo "wordpress" >> .gitignore
echo "exports" >> .gitignore
echo ".env" >> .gitignore
echo "README.md" >> .gitignore
echo "wp-cli.local.yml" >> .gitignore

git add --all
git commit -m 'update gh-pages'
git push --set-upstream origin gh-pages

trap 'git stash pop' INT TERM EXIT
git checkout master
git stash pop<commit_msg>update gh-pages<commit_after>#!/bin/bash
if [ -f .env ]; then
  source .env
elif [[ -f ../.env ]]; then
  source ../.env
fi

set -e
DIR_NAME=${PWD##*/}

if [[ $DIR_NAME != 'static' ]] && [[ `ls -A ./static` ]]; then
  cd ./static
elif [[ $DIR_NAME == 'static' ]]; then
  cd .
else
  exit
fi
DIR_NAME=${PWD##*/}

gulp production

if [[ $DIR_NAME == 'static' ]]; then
  cd ..
fi

set +e
git stash
set -e

trap 'git checkout -f master; git stash pop' INT TERM EXIT

git checkout --orphan gh-pages
cp -Rf ./static/builds/production/. ./
git rm -rf wordpress
git rm -rf static
git rm -rf exports
git rm -f .gitignore
git rm -f .env
git rm -f README.md
git rm -f wp-cli.local.yml

echo ".idea" > .gitignore
echo "static" >> .gitignore
echo "wordpress" >> .gitignore
echo "exports" >> .gitignore
echo ".env" >> .gitignore
echo "README.md" >> .gitignore
echo "wp-cli.local.yml" >> .gitignore

git add --all
git commit -m 'update gh-pages'
git push --set-upstream origin gh-pages

git checkout master
git stash pop
{'fraction_non_alphanumeric': 0.17196167423096317, 'fraction_numerical': 0.0, 'mean_word_length': 2.913214990138067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, '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': '3347929', 'n_tokens_mistral': 781, 'n_tokens_neox': 752, 'n_words': 266}