MCPcopy Create free account
hub / github.com/angular/dev-infra / addGithubTokenOption

Function addGithubTokenOption

ng-dev/utils/git/github-yargs.ts:16–32  ·  view source on GitHub ↗
(argv: Argv<T>)

Source from the content-addressed store, hash-verified

14
15/** Sets up the `github-token` command option for the given Yargs instance. */
16export function addGithubTokenOption<T>(argv: Argv<T>) {
17 return (
18 argv
19 // 'github-token' is casted to 'githubToken' to properly set up typings to reflect the key in
20 // the Argv object being camelCase rather than kebab case due to the `camel-case-expansion`
21 // config: https://github.com/yargs/yargs-parser#camel-case-expansion
22 .option('github-token' as 'githubToken', {
23 type: 'string',
24 default: '',
25 defaultDescription: '<LOCAL_TOKEN>',
26 description: 'Github token. If not set, token is retrieved from the environment variables.',
27 // We use the coerce function as a way of allowing the user to provide the value, otherwise
28 // looking for it in the environment.
29 coerce: configureGitClientWithTokenOrFromEnvironment,
30 })
31 );
32}
33
34/**
35 * If the github token is able to be determined, either by being provided as a parameter or being

Callers 10

builderFunction · 0.90
setMergeModeBuilderFunction · 0.90
builderFunction · 0.85
builderFunction · 0.85
builderFunction · 0.85
builderFunction · 0.85
builderFunction · 0.85
builderFunction · 0.85
builderFunction · 0.85
builderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected