<commit_before>#!/usr/bin/env bash
echo "##### post-receive hook #####"
read oldrev newrev refname
echo "Push triggered update to revision $newrev ($refname)"

CMD_CD="cd $(readlink -nf "$PWD/..")"
CMD_FETCH="env -i git fetch"
CMD_COMPOSER="sudo -u www-data composer install --no-dev 2>&1"
CMD_MIGRATE="sudo -u www-data vendor/bin/phinx migrate"
CMD_NPM="sudo -u www-data npm install --production"
CMD_REDIS_CLEAR="sudo -u www-data php -f includes/scripts/clear_redis_keys.php commit_id commit_time"

echo "$ $CMD_CD"
eval ${CMD_CD}
echo "$ $CMD_FETCH"
eval ${CMD_FETCH}
echo "$ $CMD_COMPOSER"
eval ${CMD_COMPOSER}
echo "$ $CMD_MIGRATE"
eval ${CMD_MIGRATE}
echo "$ $CMD_NPM"
eval ${CMD_NPM}
echo "$ $CMD_REDIS_CLEAR"
eval ${CMD_REDIS_CLEAR}

echo "##### end post-receive hook #####"<commit_msg>Fix npm install command in post-receive hook<commit_after>#!/usr/bin/env bash
echo "##### post-receive hook #####"
read oldrev newrev refname
echo "Push triggered update to revision $newrev ($refname)"

CMD_CD="cd $(readlink -nf "$PWD/..")"
CMD_FETCH="env -i git fetch"
CMD_COMPOSER="sudo -u www-data composer install --no-dev 2>&1"
CMD_MIGRATE="sudo -u www-data vendor/bin/phinx migrate"
CMD_NPM="sudo -u www-data npm install --production --no-save"
CMD_REDIS_CLEAR="sudo -u www-data php -f includes/scripts/clear_redis_keys.php commit_id commit_time"

echo "$ $CMD_CD"
eval ${CMD_CD}
echo "$ $CMD_FETCH"
eval ${CMD_FETCH}
echo "$ $CMD_COMPOSER"
eval ${CMD_COMPOSER}
echo "$ $CMD_MIGRATE"
eval ${CMD_MIGRATE}
echo "$ $CMD_NPM"
eval ${CMD_NPM}
echo "$ $CMD_REDIS_CLEAR"
eval ${CMD_REDIS_CLEAR}

echo "##### end post-receive hook #####"
{'fraction_non_alphanumeric': 0.16451810926949048, 'fraction_numerical': 0.0024554941682013503, 'mean_word_length': 5.468253968253968, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '881553', 'n_tokens_mistral': 651, 'n_tokens_neox': 616, 'n_words': 165}