diff --git a/packages/cli/commands/cms/convertFields.js b/packages/cli/commands/cms/convertFields.js index 9f59f7a46..cc681b4b7 100644 --- a/packages/cli/commands/cms/convertFields.js +++ b/packages/cli/commands/cms/convertFields.js @@ -12,6 +12,7 @@ const { } = require('@hubspot/cli-lib/lib/handleFieldsJs'); const { trackConvertFieldsUsage } = require('../../lib/usageTracking'); +const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers'); const i18nKey = 'cli.commands.convertFields'; exports.command = 'convert-fields'; @@ -54,7 +55,12 @@ exports.handler = async options => { if (fieldsJs.rejected) return; fieldsJs.saveOutput(); } else if (stats.isDirectory()) { - const filePaths = await walk(src); + let filePaths = []; + try { + filePaths = await walk(src); + } catch (e) { + logErrorInstance(e); + } const allowedFilePaths = filePaths .filter(file => { if (!isAllowedExtension(file)) { diff --git a/packages/cli/lib/projectStructure.js b/packages/cli/lib/projectStructure.js index 201169d80..a24a842ef 100644 --- a/packages/cli/lib/projectStructure.js +++ b/packages/cli/lib/projectStructure.js @@ -2,6 +2,7 @@ const fs = require('fs'); const path = require('path'); const { walk } = require('@hubspot/local-dev-lib/fs'); const { logger } = require('@hubspot/cli-lib/logger'); +const { logErrorInstance } = require('./errorHandlers/standardErrors'); const COMPONENT_TYPES = Object.freeze({ app: 'app', @@ -73,8 +74,13 @@ function getIsLegacyApp(appConfig, appPath) { async function findProjectComponents(projectSourceDir) { const components = []; + let projectFiles = []; - const projectFiles = await walk(projectSourceDir); + try { + projectFiles = await walk(projectSourceDir); + } catch (e) { + logErrorInstance(e); + } projectFiles.forEach(projectFile => { // Find app components diff --git a/packages/cli/lib/upload.js b/packages/cli/lib/upload.js index 34b8ddaf6..c4337f267 100644 --- a/packages/cli/lib/upload.js +++ b/packages/cli/lib/upload.js @@ -4,13 +4,19 @@ const { createIgnoreFilter } = require('@hubspot/local-dev-lib/ignoreRules'); const { fieldsJsPrompt } = require('../lib/prompts/cmsFieldPrompt'); const { isAllowedExtension } = require('@hubspot/cli-lib/path'); const { isConvertableFieldJs } = require('@hubspot/cli-lib/lib/handleFieldsJs'); +const { logErrorInstance } = require('./errorHandlers/standardErrors'); /* * Walks the src folder for files, filters them based on ignore filter. * If convertFields is true then will check for any JS fields conflicts (i.e., JS fields file and fields.json file) and prompt to resolve */ const getUploadableFileList = async (src, convertFields) => { - const filePaths = await walk(src); + let filePaths = []; + try { + filePaths = await walk(src); + } catch (e) { + logErrorInstance(e); + } const allowedFiles = filePaths .filter(file => { if (!isAllowedExtension(file)) { diff --git a/packages/cli/lib/usageTracking.js b/packages/cli/lib/usageTracking.js index 8067fd160..12475f02c 100644 --- a/packages/cli/lib/usageTracking.js +++ b/packages/cli/lib/usageTracking.js @@ -138,7 +138,7 @@ const trackAuthAction = async (command, authType, step, accountId) => { step, }; try { - const response = await trackUsage( + await trackUsage( 'cli-interaction', EventClass.INTERACTION, usageTrackingEvent, @@ -146,8 +146,6 @@ const trackAuthAction = async (command, authType, step, accountId) => { ); logger.debug('Sent usage tracking command event: %o', usageTrackingEvent); - - return response; } catch (e) { logger.debug('Auth action tracking failed: %s', e.message); } diff --git a/packages/cli/package.json b/packages/cli/package.json index 82d849c02..c27a2bad8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@hubspot/cli-lib": "^7.0.0", - "@hubspot/local-dev-lib": "^0.0.10", + "@hubspot/local-dev-lib": "^0.0.11", "@hubspot/serverless-dev-runtime": "5.0.3-beta.1", "@hubspot/ui-extensions-dev-server": "^0.8.0", "archiver": "^5.3.0", diff --git a/packages/serverless-dev-runtime/package.json b/packages/serverless-dev-runtime/package.json index abedbed83..8a86e0662 100644 --- a/packages/serverless-dev-runtime/package.json +++ b/packages/serverless-dev-runtime/package.json @@ -7,7 +7,7 @@ "license": "Apache-2.0", "dependencies": { "@hubspot/cli-lib": "^7.0.0", - "@hubspot/local-dev-lib": "^0.0.10", + "@hubspot/local-dev-lib": "^0.0.11", "body-parser": "^1.19.0", "chalk": "^4.1.0", "chokidar": "^3.4.3", diff --git a/packages/webpack-cms-plugins/package.json b/packages/webpack-cms-plugins/package.json index acd35b24c..234fa64f2 100644 --- a/packages/webpack-cms-plugins/package.json +++ b/packages/webpack-cms-plugins/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@hubspot/cli-lib": "^7.0.0", - "@hubspot/local-dev-lib": "^0.0.10" + "@hubspot/local-dev-lib": "^0.0.11" }, "gitHead": "0659fd19cabc3645af431b177c11d0c1b089e0f8" }