From cf4a4587490ed84d47fd6483989e5e0e19550ad4 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Tue, 8 Oct 2024 17:47:30 -0700 Subject: [PATCH] one ring to rule them all --- src/BaseCommand.js | 2 ++ src/commands/app/deploy.js | 1 - src/commands/app/run.js | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BaseCommand.js b/src/BaseCommand.js index 9a8e18cb..529ee3fa 100644 --- a/src/BaseCommand.js +++ b/src/BaseCommand.js @@ -31,6 +31,7 @@ const { } = require('@adobe/aio-lib-env') class BaseCommand extends Command { + // default error handler for app commands async catch (error) { const { flags } = await this.parse(this.prototype) @@ -42,6 +43,7 @@ class BaseCommand extends Command { await super.init() // setup a prompt that outputs to stderr this.prompt = inquirer.createPromptModule({ output: process.stderr }) + process.env.__OW_USER_AGENT = 'aio-cli-plugin-app@' + require('../package.json').version } async getLibConsoleCLI () { diff --git a/src/commands/app/deploy.js b/src/commands/app/deploy.js index 0d9f50f1..7781f11a 100644 --- a/src/commands/app/deploy.js +++ b/src/commands/app/deploy.js @@ -31,7 +31,6 @@ class Deploy extends BuildCommand { // cli input const { flags } = await this.parse(Deploy) - process.env.__OW_USER_AGENT = 'aio-cli-plugin-app@' + require('../../../package.json').version // flags flags['web-assets'] = flags['web-assets'] && !flags.action flags.publish = flags.publish && !flags.action diff --git a/src/commands/app/run.js b/src/commands/app/run.js index 767aa10b..f48c65cb 100644 --- a/src/commands/app/run.js +++ b/src/commands/app/run.js @@ -36,7 +36,6 @@ class Run extends BaseCommand { // cli input const { flags } = await this.parse(Run) - process.env.__OW_USER_AGENT = 'aio-cli-plugin-app@' + require('../../../package.json').version if (flags.local) { const [firstCpu] = os.cpus() // note: the earliest versions of M1 macs return 'Apple processor' under model.