template generator should report err msg and exit if download fails

This commit is contained in:
Michael Bradley, Jr 2018-09-11 15:19:15 -05:00
parent ed48599aa9
commit a44be3740b
1 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,11 @@ class TemplateGenerator {
console.log(__('Installing Template from ' + uri + '....').green);
fs.mkdirpSync(utils.dirname(tmpFilePath));
utils.downloadFile(url, tmpFilePath, () => {
utils.downloadFile(url, tmpFilePath, (err) => {
if (err) {
console.error(err.red);
process.exit(1);
}
utils.extractZip(tmpFilePath, fspath, {
map: file => {
let fixed_path = file.path.split('/');