Skip to content

Commit

Permalink
feat: allow to disable default values
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Aug 15, 2024
1 parent 101ba0b commit 73784ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ Options:
>
> Only `50` issues are fetched from JIRA at a time. If you want to triage more than `50` issues just run the command again.
> [!TIP]
>
> You can disable default values by setting `NODEFAULTS` environment variable to `true`:
>
> ```bash
> NODEFAULTS=true npx storypointer
> ```
### Examples
Size all issues of the `curl` component:
Expand Down
9 changes: 9 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ export function getUserFromLogin(): string {
return `${login}@redhat.com`;
}

export function isDefaultValuesDisabled(): boolean {
return process.env['NODEFAULTS'] ? true : false;
}

export function getDefaultValue(
envName: 'ASSIGNEE' | 'COMPONENT' | 'DEVELOPER'
) {
console.log(`isDisabled: ${isDefaultValuesDisabled()}`);
if (isDefaultValuesDisabled()) {
return undefined;
}

const value = process.env[envName];

if (envName === 'ASSIGNEE' && !value) {
Expand Down

0 comments on commit 73784ce

Please sign in to comment.