Skip to content

Commit

Permalink
Add app/version useragent for tracking clients in runtime (#814)
Browse files Browse the repository at this point in the history
* Add app/version useragent for tracking clients in runtime
* one ring to rule them all
* I never get tired of being held up by silly linting rules protecting whitespace.
* generate realish useragent with more info
  • Loading branch information
purplecabbage authored Nov 9, 2024
1 parent b1b95f6 commit 5b779aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/BaseCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ class BaseCommand extends Command {
await super.init()
// setup a prompt that outputs to stderr
this.prompt = inquirer.createPromptModule({ output: process.stderr })

// set User-Agent for runtime calls
// ex. aio-cli-plugin-app/@adobe/aio-cli/10.3.1 (darwin-arm64; node-v18.20.4; zsh)
const vs = this.config.versionDetails
// some tests might not have this set, so we use ? nullish coalescing
process.env.__OW_USER_AGENT =
`aio-cli-plugin-app/${vs?.cliVersion} (${vs?.architecture}; ${vs?.nodeVersion}; ${vs?.shell})`
}

async getLibConsoleCLI () {
Expand Down

0 comments on commit 5b779aa

Please sign in to comment.