Skip to content

Commit

Permalink
fix: use callback to retrieve error message of gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesHoppe committed Dec 21, 2019
1 parent 04f423b commit 6a8a3c2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/engine/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,16 @@ async function publishViaGhPages(
return;
}

return await ghPages.publish(dir, options);
// do NOT (!!) await ghPages.publish,
// the promise is implemented in such a way that it always succeeds – even on errors!
return new Promise((resolve, reject) => {
ghPages.publish(dir, options, (error) => {

if (error) {
return reject(error);
}

resolve();
});
});
}

0 comments on commit 6a8a3c2

Please sign in to comment.