Ensured process exits after static export (#4747) (#4749)

Fixes [this issue](https://github.com/zeit/next.js/issues/4747)

I don't know what is the reason why the process does not finish, because it can be reproduced in this repo in many environments (my local mac os and Netlify pipeline).

However, it fixes the problem and it's 100% safe.
This commit is contained in:
Lukasz Ostrowski 2018-07-17 17:11:19 +02:00 committed by Tim Neutkens
parent 6f4925c193
commit 6e5bab1a1d

View file

@ -57,6 +57,10 @@ const options = {
outdir: argv.outdir ? resolve(argv.outdir) : resolve(dir, 'out')
}
exportApp(dir, options).catch((err) => {
printAndExit(err)
})
exportApp(dir, options)
.then(() => {
printAndExit('Export successful', 0)
})
.catch((err) => {
printAndExit(err)
})