From 4c71a855f0a91ec014ef1ef7918cb9e0bb9004f4 Mon Sep 17 00:00:00 2001 From: Brent Hosie Date: Mon, 19 Apr 2021 12:36:13 -0600 Subject: [PATCH] PDCL-5086: optional chaining is only available in node >= 14, which is higher than our recommendation --- bin/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/index.js b/bin/index.js index ea14c03..0ab17c6 100755 --- a/bin/index.js +++ b/bin/index.js @@ -66,7 +66,7 @@ const checkOldProductionEnvironmentVariables = require('./checkOldProductionEnvi if (argv.verbose) { require('request-debug')(require('request-promise-native'), function(type, data, r) { const filteredData = { ...data }; - if (filteredData.headers?.Authorization) { + if (filteredData.headers && filteredData.headers.Authorization) { filteredData.headers.Authorization = 'Bearer [USER_ACCESS_TOKEN]' } console.error({ [type]: filteredData }) @@ -108,6 +108,7 @@ const checkOldProductionEnvironmentVariables = require('./checkOldProductionEnvi } console.log(chalk.bold.red(error.message)); + console.log(chalk.bold.red('run in --verbose mode for more info')); process.exitCode = 1; } })();