Straightened a promise and use mkdirp to ensure the directory.