<commit_before>#!/bin/bash
branch=${1:-"master"}
echo "Deploying $branch to gh-pages"
git checkout $branch
cd htck
# Update all dependencies
npm cache clean
npm install
bower install
# Build app
grunt build --force
xargs rm -rf < build_tools/rm_on_deploy
cd ..

# Create dist zip file
cd htck
cp -R dist htck-Bayeux
zip -r htck-Bayeux.zip htck-Bayeux/
mv htck-Bayeux.zip dist/
rm -rf htck-Bayeux
cd ..

git branch -D gh-pages 
# Save built app to tmp folder
cp -R htck/dist/ /tmp/
cp htck/build_tools/git_add_on_deploy /tmp
git checkout --orphan gh-pages
# Remove all git tracked files (keeps libs and node_modules)
git ls-files -z | xargs -0 rm -f
rm .gitignore
# Move back built app
mv /tmp/dist/* .
# Deploy
xargs git add < /tmp/git_add_on_deploy
git commit -am "Deploying $branch to gh-pages"
git push --delete origin gh-pages
git push --set-upstream origin gh-pages
git checkout master<commit_msg>Update deployment script<commit_after>#!/bin/bash
branch=${1:-"master"}
remote=${2:-"https://github.com/htck/bayeux.git"}
echo "Deploying $branch to gh-pages $remote"
git checkout $branch
cd htck
# Update all dependencies
npm cache clean
npm install
bower install
# Build app
grunt build --force
cd ..

# Create dist zip file
cd htck
cp -R dist htck-Bayeux
zip -r htck-Bayeux.zip htck-Bayeux/
mv htck-Bayeux.zip dist/
rm -rf htck-Bayeux
cd ..

######

echo "Creating temporary deployment folder"
rm -rf /tmp/bayeux-ghost
mkdir /tmp/bayeux-ghost
cp -R htck/dist/* /tmp/bayeux-ghost/
cp -R htck/app/images /tmp/bayeux-ghost/
cd /tmp/bayeux-ghost
echo "Initing ghost git"
git init
echo "Add remote $remote"
git remote add origin $remote
git checkout -b gh-pages
rm .gitignore
git add .
git commit -am "Deploying $branch to gh-pages"
git push --force origin gh-pages

######

{'fraction_non_alphanumeric': 0.11449520586576424, 'fraction_numerical': 0.0022560631697687537, 'mean_word_length': 3.693121693121693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3155240', 'n_tokens_mistral': 695, 'n_tokens_neox': 662, 'n_words': 230}