Skip to content

Commit 6a8a3c2

Browse files
committed
fix: use callback to retrieve error message of gh-pages
1 parent 04f423b commit 6a8a3c2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/engine/engine.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,5 +205,16 @@ async function publishViaGhPages(
205205
return;
206206
}
207207

208-
return await ghPages.publish(dir, options);
208+
// do NOT (!!) await ghPages.publish,
209+
// the promise is implemented in such a way that it always succeeds – even on errors!
210+
return new Promise((resolve, reject) => {
211+
ghPages.publish(dir, options, (error) => {
212+
213+
if (error) {
214+
return reject(error);
215+
}
216+
217+
resolve();
218+
});
219+
});
209220
}

0 commit comments

Comments
 (0)