<commit_before>#!/bin/bash
set -e

upload() {
	ssh $1 mkdir /tmp/$2
	scp deploy/prepare.sh deploy/promote.sh deploy/upgrade.sh dist/*.whl $1:/tmp/$2
	ssh $1 chmod +x /tmp/$2/prepare.sh /tmp/$2/promote.sh /tmp/$2/upgrade.sh
}

usage() {
	me=$(basename $0)
	echo "usage: ./$me <list of ip address split by spaces>"
	exit 1
}

main() {
	if [[ $@ ]]; then
		workdir=$(dirname $0)/..
		cd $workdir
		rm -rf dist/
		revision=$(cat .git/$(awk '{print $2}' .git/HEAD))
		python setup.py egg_info -b "-$revision" bdist_wheel
			for address in "$@"; do
				echo "Deploying to $address."
				temp=$(upload $address $revision)
				ssh $address /tmp/$revision/prepare.sh
				ssh $address /tmp/$revision/upgrade.sh
			done
			for address in "$@"; do
				ssh $address /tmp/$revision/promote.sh
			done
	else
		usage
	fi
}<commit_msg>egg_info converts hyphen to underscore<commit_after>#!/bin/bash
set -e

upload() {
	ssh $1 mkdir /tmp/$2
	scp deploy/prepare.sh deploy/promote.sh deploy/upgrade.sh dist/*.whl $1:/tmp/$2
	ssh $1 chmod +x /tmp/$2/prepare.sh /tmp/$2/promote.sh /tmp/$2/upgrade.sh
}

usage() {
	me=$(basename $0)
	echo "usage: ./$me <list of ip address split by spaces>"
	exit 1
}

main() {
	if [[ $@ ]]; then
		workdir=$(dirname $0)/..
		cd $workdir
		rm -rf dist/
		revision=$(cat .git/$(awk '{print $2}' .git/HEAD))
		python setup.py egg_info -b "_$revision" bdist_wheel
			for address in "$@"; do
				echo "Deploying to $address."
				temp=$(upload $address $revision)
				ssh $address /tmp/$revision/prepare.sh
				ssh $address /tmp/$revision/upgrade.sh
			done
			for address in "$@"; do
				ssh $address /tmp/$revision/promote.sh
			done
	else
		usage
	fi
}
{'fraction_non_alphanumeric': 0.17519566526189043, 'fraction_numerical': 0.014449127031908489, 'mean_word_length': 2.9951923076923075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4962778', 'n_tokens_mistral': 725, 'n_tokens_neox': 637, 'n_words': 176}