fix creating output directories in bare scripts