<commit_before>#! /bin/bash
while [[ $# > 1 ]]
do
key="$1"

case $key in
	-e|--environment)
	ENVIRONMENT="$2"
	shift
	;;
	--default)
	DEFAULT=YES
	shift
	;;
	*)

	;;
esac
shift
done

DEPLOY_DIRECTORY="/var/src/www"

if ${ENVIRONMENT = "dev"} 
	if [-d "$DEPLOY_DIRECTORY"]; then
	    cp ./www $DEPLOY_DIRECTORY
	    else
	    mkdir /var/src/www
            cp ./www $DEPLOY_DIRECTORY
	fi
	cd $DEPLOY_DIRECTORY
	find . -type f -exec sed -i '' 's/\{{MIN}}//g {} +
	
fi
if ${ENVIRONMENT = "prod"}
	find . -type f -name '*.css' -printf '%h\n' | sort | uniq | while read file
	do
		cd $file
		yuicompressor -o '.css$:-min.css' *.css
		cd -
	done
	find . -type f -name '*.js' -printf '%h\n' | sort | uniq | while read file
	do
		cd $file
		yuicompressor -o '.js$:-min.js' *.js
		cd -
	done
	
	current_build =$(date +%s)
	current_tag = `date +%Y.%m.%d.%H%M`
	find . -type f -name '*.html' -exec sed -i '' 's/\{{VERSION}}/$current_build/g {} +
	git add .
        git tag -a $ $current_tag -m 'Production deployment build $current_tag'
	git commit -m "generating build for version $current_build"
	git push origin $current_tag


      if [-d "$DEPLOY_DIRECTORY"]; then
      	cp ./www $DEPLOY_DIRECTORY
      else
        mkdir /var/src/www
        cp ./www $DEPLOY_DIRECTORY
      fi
      cd $DEPLOY_DIRECTORY
      find . -type f -name '*.html' -exec sed -i '' 's/\{{MIN}}/-min/g {} +
      sudo service nginx restart
fi


<commit_msg>bash hates me. Not really.<commit_after>#! /bin/bash
while [[ $# > 1 ]]
do
key="$1"

case $key in
	-e|--environment)
	ENVIRONMENT="$2"
	shift
	;;
	--default)
	DEFAULT=YES
	shift
	;;
	*)

	;;
esac
shift
done

DEPLOY_DIRECTORY="/var/src/www"

if [ $ENVIRONMENT = "dev" ]; then 
      	mkdir -p $DEPLOY_DIRECTORY && cp ./www -R $DEPLOY_DIRECTORY
	cd $DEPLOY_DIRECTORY
	find . -type f -exec sed -i.bak '' 's/\{{MIN}}//g' {} +
fi
if [ $ENVIRONMENT == "prod" ]; then
	find . -type f -name '*.css' -printf '%h\n' | sort | uniq | while read file
	do
		cd $file
		yuicompressor -o '.css$:-min.css' *.css
		cd -
	done
	find . -type f -name '*.js' -printf '%h\n' | sort | uniq | while read file
	do
		cd $file
		yuicompressor -o '.js$:-min.js' *.js
		cd -
	done
	
	current_build =$(date +%s)
	current_tag = `date +%Y.%m.%d.%H%M`
	find . -type f -name '*.html' -exec sed -i '' 's/\{{VERSION}}/$current_build/g {} +
	git add .
        git tag -a $ $current_tag -m 'Production deployment build $current_tag'
	git commit -m "generating build for version $current_build"
	git push origin $current_tag


      	mkdir -p $DEPLOY_DIRECTORY && cp ./www -R $DEPLOY_DIRECTORY
      fi
      cd $DEPLOY_DIRECTORY
      find . -type f -name '*.html' -exec sed -i.bak '' 's/\{{MIN}}/-min/g' {} +
      sudo service nginx restart
fi



{'fraction_non_alphanumeric': 0.17500913408841798, 'fraction_numerical': 0.0021921812203142127, 'mean_word_length': 2.4483627204030225, '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': '6728253', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1095, 'n_words': 311}