Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVELOP-768 Update create contribution script to allow secret extension settings #51

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/utils/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function getContributionFromQuestions() {
recordTypes: answers.recordTypes,
handles: answers.handles,
description: answers.description,
default: answers.default,
default: answers.type === 'secret' ? null : answers.default,
type: answers.type,
scope: answers.scope,
},
Expand Down Expand Up @@ -169,7 +169,7 @@ export const contributionQuestions = [
type: 'list',
name: 'type',
message: 'Enter the type for your setting:',
choices: ['boolean', 'color', 'string', 'number'],
choices: ['boolean', 'color', 'string', 'number', 'secret'],
default: 'color',
when: (answers: StringAnswers) => answers.contributionType === 'settings',
},
Expand All @@ -187,6 +187,8 @@ export const contributionQuestions = [
return 'Description';
case 'number':
return 'Choose a number';
case 'secret':
return 'Authentication token';
}
},
when: (answers: StringAnswers) => answers.contributionType === 'settings',
Expand All @@ -207,7 +209,8 @@ export const contributionQuestions = [
return '42';
}
},
when: (answers: StringAnswers) => answers.contributionType === 'settings',
when: (answers: StringAnswers) =>
answers.contributionType === 'settings' && answers.type !== 'secret',
},
{
type: 'checkbox',
Expand Down