diff --git a/lib/alias.js b/lib/alias.js index 0459ba3..ad67ca2 100644 --- a/lib/alias.js +++ b/lib/alias.js @@ -245,6 +245,16 @@ export default class Alias extends Now { return this.createAlias(depl, alias); } + if ('cert_expired' === code) { + console.log(`> Renewing certificate for ${chalk.underline(chalk.bold(alias))}`); + + try { + await this.createCert(alias, { renew: true }); + } catch (err) { + return bail(err); + } + } + return bail(new Error(body.error.message)); }