adding error checking to publish_repos.sh