#!/bin/bash FILE=$1 OUTPUT_FOLDER=output install_mo() { local confirm if ! command -v "bin/mo" 2>&1 > /dev/null; then read -p "You don't have mo installed. Install? (Y/n) " -n 1 -r confirm case $confirm in [yY]) curl -s https://raw.githubusercontent.com/tests-always-included/mo/master/mo > bin/mo chmod +x bin/mo ;; *) exit 1 ;; esac fi } build(){ mkdir -p $OUTPUT_FOLDER source thomas.env && cat templates/$1 | bin/mo > $OUTPUT_FOLDER/$FILE } install_mo build echo $OUTPUT_FOLDER/$FILE