<commit_before>#!/bin/bash

ME=$(basename $0)
TEMPLATE_DIR="${ROOTIQUE}/common/database/templates"

function usage() {
	echo "Usage: ${ME} [ deps | sync ]"
}

function setup_database() {
	rm database/db.sqlite3
	./database/sql_scripts/create_db.py
	sync_database
}

function sync_database() {
	./database/sql_scripts/seed_db.py game_engine
	generate_templates
	./database/sql_scripts/seed_db.py template
}

function generate_templates() {
	rm -r ${TEMPLATE_DIR}
	mkdir -p ${TEMPLATE_DIR}

	pushd ../game_engine
	GOPATH=$(pwd) go run templater.go -filepath=${TEMPLATE_DIR}
	popd
}

function install_deps() {
	sudo pip install -r requirements.txt
}

function main() {
	if [ $# -lt 1 ]; then
			setup_database
	else
		if [ $1 == 'deps' ]; then
			install_deps
		elif [ $1 == 'sync' ]; then
			sync_database
		else
			usage
		fi
	fi
}

main $@
<commit_msg>Use new template writer (using engine.go)<commit_after>#!/bin/bash

ME=$(basename $0)
TEMPLATE_DIR="${ROOTIQUE}/common/database/templates"

function usage() {
	echo "Usage: ${ME} [ deps | sync ]"
}

function setup_database() {
	rm database/db.sqlite3
	./database/sql_scripts/create_db.py
	sync_database
}

function sync_database() {
	./database/sql_scripts/seed_db.py game_engine
	generate_templates
	./database/sql_scripts/seed_db.py template
}

function generate_templates() {
	rm -r ${TEMPLATE_DIR}
	mkdir -p ${TEMPLATE_DIR}

	pushd ../game_engine
	GOPATH=$(pwd) go run engine.go -write_templates=true -template_out_dir=${TEMPLATE_DIR}
	popd
}

function install_deps() {
	sudo pip install -r requirements.txt
}

function main() {
	if [ $# -lt 1 ]; then
			setup_database
	else
		if [ $1 == 'deps' ]; then
			install_deps
		elif [ $1 == 'sync' ]; then
			sync_database
		else
			usage
		fi
	fi
}

main $@

{'fraction_non_alphanumeric': 0.13700966458214894, 'fraction_numerical': 0.005685048322910745, 'mean_word_length': 3.9858356940509916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5667278', 'n_tokens_mistral': 700, 'n_tokens_neox': 657, 'n_words': 146}