<commit_before>#!/bin/bash
# Use to install the latest cyber-dojo git repo onto a cyber-dojo server

if [ -d "/var/www/cyber-dojo" ]; then
  export cyberDojoName=cyber-dojo
else
  export cyberDojoName=cyberdojo
fi

export cyberDojoHome=/var/www/$cyberDojoName

cd $cyberDojoHome

# get latest source from https://github.com/JonJagger/cyber-dojo
# if it asks for a password just hit return
git pull --no-edit origin master
ret=$?
if [ $ret -ne 0 ]; then
  exit
fi

apt-get install -y acl

# cyber-dojo creates folders under katas
echo "chown/chgrp www-data katas"
chmod g+rwsx katas
setfacl -d -m group:www-data:rwx $cyberDojoHome/katas
setfacl -m group:www-data:rwx $cyberDojoHome/katas

# ensure pulled files have correct rights
for folder in app config exercises languages lib log notes public script spec test
do
  echo "chown/chgrp www-data ${folder}"
  chown -R www-data $cyberDojoHome/$folder
  chgrp -R www-data $cyberDojoHome/$folder
done

# tests create folders under tests/cyberdojo/katas
echo "chown/chgrp www-data $cyberDojoHome/test/cyberdojo/katas"
chmod g+rwsx $cyberDojoHome/test/cyberdojo/katas
setfacl -d -m group:www-data:rwx $cyberDojoHome/test/cyberdojo/katas
setfacl -m group:www-data:rwx $cyberDojoHome/test/cyberdojo/katas
<commit_msg>refactoring<commit_after>#!/bin/bash
# Use to install the latest cyber-dojo git repo onto a cyber-dojo server

if [ -d "/var/www/cyber-dojo" ]; then
  export cyberDojoName=cyber-dojo
else
  export cyberDojoName=cyberdojo
fi

export cyberDojoHome=/var/www/$cyberDojoName

cd $cyberDojoHome

# get latest source from https://github.com/JonJagger/cyber-dojo
# if it asks for a password just hit return
git pull --no-edit origin master
ret=$?
if [ $ret -ne 0 ]; then
  exit
fi

apt-get install -y acl

# cyber-dojo creates folders under katas
echo "chown/chgrp www-data katas"
chmod g+rwsx katas
setfacl -d -m group:www-data:rwx $cyberDojoHome/katas
setfacl -m group:www-data:rwx $cyberDojoHome/katas

# ensure pulled files have correct rights
for folder in app config exercises languages lib log notes public script spec test
do
  echo "chown/chgrp www-data ${folder}"
  chown -R www-data $cyberDojoHome/$folder
  chgrp -R www-data $cyberDojoHome/$folder
done

# tests create folders under tests/cyberdojo/katas
echo "chown/chgrp www-data test/cyberdojo/katas"
chmod g+rwsx $cyberDojoHome/test/cyberdojo/katas
setfacl -d -m group:www-data:rwx $cyberDojoHome/test/cyberdojo/katas
setfacl -m group:www-data:rwx $cyberDojoHome/test/cyberdojo/katas

{'fraction_non_alphanumeric': 0.09676129548180727, 'fraction_numerical': 0.0007996801279488205, 'mean_word_length': 4.4868421052631575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 22, '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': '6920088', 'n_tokens_mistral': 950, 'n_tokens_neox': 943, 'n_words': 268}