<commit_before>#!/usr/bin/env bash
set -e # halt script on error
# Install hugo; hugo server --watch &
#  hugo new post/name.md --editor=gedit &
# Filesystem:
#  init a new working copy:
#  rm -rf public; git rm public # make idempotent
#  git submodule add --force <EMAIL>:mlavi/mlavi.github.io.git public
#  rm -rf public/*; ./deploy.sh

if [[ ! -f bugs.yaml ]]; then
  TEST=1
fi

# http://jekyllrb.com/docs/continuous-integration/
# http://gohugo.io/tutorials/github-pages-blog/

echo -e "\nSTART: Spell check contents..."
find content -name "*.md" -execdir aspell --mode=html --warn check {} \;
find content -name "*.md.bak" -delete
find content -name "*~" -delete
echo 'TODO: grep -R -e "/`grep status archetypes/default.md`/" content/'

echo -e "\nSTART: building project..."
rm -rf public/*
hugo --verbose
if [[ $? > 0 ]]; then
  echo "ERROR: build, exiting."; exit 1;
fi

# Test the generated HTML
# https://github.com/gjtorikian/html-proofer
if [[ ${TEST} ]]; then
  echo -e "\nSTART: test..."
  bundle exec htmlproof --verbose ./public
  if [[ $? > 0 ]]; then
    echo "ERROR: test, exiting."; exit 1;
  fi
else
  echo -e "\n SKIP: test..."
fi

echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"

# Commit changes.
cd public && git add --all
msg="rebuilding site `date`"
if [ $# -eq 1 ]
  then msg="$1"
fi
git commit -m "$msg"

# Push source and build repos.
git push origin master
cd ..
<commit_msg>Add fish function<commit_after>#!/usr/bin/env bash
set -e # halt script on error
# Install hugo; hugo server --watch &
#  hugo new post/name.md --editor=gedit &
# ____ Filesystem:
#  init a new working copy:
#  rm -rf public; git rm public # make idempotent
#  git submodule add --force <EMAIL>:mlavi/mlavi.github.io.git public
#  rm -rf public/*; ./deploy.sh
# ____ Fish: function slides
#  cd ~/Documents/github.com/mlavi/hugo/static/slides
#  echo; pwd; ls
#  . landslide/bin/activate.fish
#  echo 'set PAGE x watchmedo shell-command --pattern="*.md" --command="landslide --relative --embed --quiet $PAGE.md --destination $PAGE.html" &'
# end

if [[ ! -f bugs.yaml ]]; then
  TEST=1
fi

# http://jekyllrb.com/docs/continuous-integration/
# http://gohugo.io/tutorials/github-pages-blog/

echo -e "\nSTART: Spell check contents..."
find content -name "*.md" -execdir aspell --mode=html --warn check {} \;
find content -name "*.md.bak" -delete
find content -name "*~" -delete
echo 'TODO: grep -R -e "/`grep status archetypes/default.md`/" content/'

echo -e "\nSTART: building project..."
rm -rf public/*
hugo --verbose
if [[ $? > 0 ]]; then
  echo "ERROR: build, exiting."; exit 1;
fi

# Test the generated HTML
# https://github.com/gjtorikian/html-proofer
if [[ ${TEST} ]]; then
  echo -e "\nSTART: test..."
  bundle exec htmlproof --verbose ./public
  if [[ $? > 0 ]]; then
    echo "ERROR: test, exiting."; exit 1;
  fi
else
  echo -e "\n SKIP: test..."
fi

echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"

# Commit changes.
cd public && git add --all
msg="rebuilding site `date`"
if [ $# -eq 1 ]
  then msg="$1"
fi
git commit -m "$msg"

# Push source and build repos.
git push origin master
cd ..

{'fraction_non_alphanumeric': 0.17225950782997762, 'fraction_numerical': 0.010866091403004154, 'mean_word_length': 3.043927648578811, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '1611467', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1118, 'n_words': 370}