Write output to buildupdate.sh
Create output directory if it doesn't exist
BUG: Still need to handle dir/** in pattern match