From a01a89c8096eaeccd427cc3434154be2cd2e087a Mon Sep 17 00:00:00 2001 From: NGPixel Date: Fri, 18 Nov 2022 21:30:08 -0500 Subject: [PATCH] fix: pull image await via stream --- index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f2057f7..dde5210 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,18 @@ async function upgrade (name, version) { console.info('Container has been removed.') console.info('Pulling latest Wiki.js image...') - await dk.pull(`ghcr.io/requarks/wiki:${version}`) + await new Promise((resolve, reject) => { + dk.pull(`ghcr.io/requarks/wiki:${version}`, (err, stream) => { + if (err) { return reject(err) } + docker.modem.followProgress(stream, (err) => { + if (err) { + reject(err) + } else { + resolve() + } + }) + }) + }) console.info('Recreating container...') const wkn = await dk.createContainer({