<commit_before>#!/bin/sh

#
# Execute Makefile tasks on all tenants for each environment.
#

tenant=$1
vault=$2
env=$3
args=$4
make_tenant=$5

# Check if files are already encrypted; if so, exit gracefully because there is nothing to do
FILES=`find ~/.appflow/tenant/$tenant/$env/`
ENC=true
for f in $FILES; do 
	if [ -f $f ]; then
		status=`grep AES256 $f > /dev/null; echo $?`
		if [ $status -eq 0 ]; then 
			echo "Files are already encrpyted, nothing to do."
		else
			ENC=false
		fi
	fi
done
find ~/.appflow/tenant/$tenant/$env -type f -exec md5sum {} > /tmp/.appflow-$USER/$tenant/appflow-$env-md5-new \;
changed_files=`(diff /tmp/.appflow-$USER/$tenant/appflow-$env-md5 /tmp/.appflow-$USER/$tenant/appflow-$env-md5-new | cut -d " " -f 4 | grep "/" | sort | uniq )`
if [ $ENC == false ]; then
	make encrypt tenant=$make_tenant env=$env
fi
echo $changed_files  | tr ' ' '\n' |  xargs git -C ~/.appflow/tenant/$tenant add
git -C ~/.appflow/tenant/$tenant commit -m "Auto commit"
git -C ~/.appflow/tenant/$tenant push
git -C ~/.appflow/tenant/$tenant/$env checkout .
rm /tmp/.appflow-$USER/$tenant/appflow-$env-md5-new<commit_msg>Fixed boolean check.<commit_after>#!/bin/sh

#
# Execute Makefile tasks on all tenants for each environment.
#

tenant=$1
vault=$2
env=$3
args=$4
make_tenant=$5

# Check if files are already encrypted; if so, exit gracefully because there is nothing to do
FILES=`find ~/.appflow/tenant/$tenant/$env/`
ENC=true
for f in $FILES; do 
	if [ -f $f ]; then
		status=`grep AES256 $f > /dev/null; echo $?`
		if [ $status -eq 0 ]; then 
			echo "Files are already encrpyted, nothing to do."
		else
			ENC=false
		fi
	fi
done
find ~/.appflow/tenant/$tenant/$env -type f -exec md5sum {} > /tmp/.appflow-$USER/$tenant/appflow-$env-md5-new \;
changed_files=`(diff /tmp/.appflow-$USER/$tenant/appflow-$env-md5 /tmp/.appflow-$USER/$tenant/appflow-$env-md5-new | cut -d " " -f 4 | grep "/" | sort | uniq )`
if [ "$ENC" = false ]; then
	make encrypt tenant=$make_tenant env=$env
fi
echo $changed_files  | tr ' ' '\n' |  xargs git -C ~/.appflow/tenant/$tenant add
git -C ~/.appflow/tenant/$tenant commit -m "Auto commit"
git -C ~/.appflow/tenant/$tenant push
git -C ~/.appflow/tenant/$tenant/$env checkout .
rm /tmp/.appflow-$USER/$tenant/appflow-$env-md5-new
{'fraction_non_alphanumeric': 0.17150395778364116, 'fraction_numerical': 0.013192612137203167, 'mean_word_length': 3.443359375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6565294', 'n_tokens_mistral': 868, 'n_tokens_neox': 855, 'n_words': 237}