diff --git a/bin/now-logs.js b/bin/now-logs.js index c375221..3c75123 100644 --- a/bin/now-logs.js +++ b/bin/now-logs.js @@ -115,7 +115,7 @@ Promise.resolve() let token try { - token = config.token || login(apiUrl) + token = config.token || (await login(apiUrl)) } catch (err) { error(`Authentication error – ${err.message}`) process.exit(1) diff --git a/bin/now-remove.js b/bin/now-remove.js index 2736bc2..e585128 100755 --- a/bin/now-remove.js +++ b/bin/now-remove.js @@ -91,7 +91,7 @@ Promise.resolve() let token try { - token = config.token || login(apiUrl) + token = config.token || (await login(apiUrl)) } catch (err) { error(`Authentication error – ${err.message}`) process.exit(1) diff --git a/lib/index.js b/lib/index.js index a5361c4..b51ed39 100644 --- a/lib/index.js +++ b/lib/index.js @@ -382,7 +382,7 @@ module.exports = class Now extends EventEmitter { if (this._debug) { console.log('> [debug] bailing on listing due to %s', res.status) } - return bail(responseError(res)) + return bail(await responseError(res)) } if (res.status !== 200) { @@ -417,7 +417,7 @@ module.exports = class Now extends EventEmitter { if (this._debug) { console.log('> [debug] bailing on listing due to %s', res.status) } - return bail(responseError(res)) + return bail(await responseError(res)) } if (res.status !== 200) {