Skip to content

Commit 52893c9

Browse files
Ensured existence and corrected templates
1 parent 7fdc70f commit 52893c9

File tree

7 files changed

+31
-8
lines changed

7 files changed

+31
-8
lines changed

src/shared/options/augmentOptionsWithExcludes.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const optionsBase = {
88
base: undefined,
99
createRepository: undefined,
1010
description: "",
11-
email: undefined,
11+
email: {
12+
github: "[email protected]",
13+
14+
},
1215
excludeCompliance: undefined,
1316
excludeContributors: undefined,
1417
excludeLintJson: undefined,

src/shared/options/readOptions.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,22 @@ export async function readOptions(args: string[]): Promise<OptionsParseResult> {
169169
logo = { alt, src: options.logo };
170170
}
171171

172+
const email =
173+
options.email ??
174+
(await defaults.email()) ??
175+
(await getPrefillOrPromptedOption(
176+
undefined,
177+
"What email should be used in package.json and .md files?",
178+
));
179+
if (!email) {
180+
return { cancelled: true, options };
181+
}
182+
172183
const augmentedOptions = await augmentOptionsWithExcludes({
173184
...options,
174185
author: options.author ?? (await defaults.owner()),
175186
description: options.description,
176-
email: options.email ?? (await defaults.email()),
187+
email: typeof email === "string" ? { github: email, npm: email } : email,
177188
funding: options.funding ?? (await defaults.funding()),
178189
logo,
179190
owner: options.owner,

src/shared/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface Options {
3434
base?: InputBase;
3535
createRepository?: boolean;
3636
description: string;
37-
email?: OptionsEmail;
37+
email: OptionsEmail;
3838
excludeCompliance?: boolean;
3939
excludeContributors?: boolean;
4040
excludeLintJson?: boolean;

src/steps/finalizeDependencies.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ const options = {
2121
base: "everything",
2222
createRepository: undefined,
2323
description: "Stub description.",
24-
email: undefined,
24+
email: {
25+
github: "[email protected]",
26+
27+
},
2528
excludeCompliance: undefined,
2629
excludeContributors: undefined,
2730
excludeLintJson: undefined,

src/steps/updateLocalFiles.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const options = {
2424
base: "everything",
2525
createRepository: undefined,
2626
description: "Stub description.",
27-
email: undefined,
27+
email: {
28+
github: "[email protected]",
29+
30+
},
2831
excludeCompliance: undefined,
2932
excludeContributors: undefined,
3033
excludeLintJson: undefined,

src/steps/writeReadme/generateTopContent.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const optionsBase = {
77
base: undefined,
88
createRepository: undefined,
99
description: "",
10-
email: undefined,
10+
email: {
11+
github: "[email protected]",
12+
13+
},
1114
excludeCompliance: undefined,
1215
excludeContributors: undefined,
1316
excludeLintJson: undefined,

src/steps/writing/creation/dotGitHub/createDotGitHubFiles.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ representative at an online or offline event.
6868
6969
Instances of abusive, harassing, or otherwise unacceptable behavior may be
7070
reported to the community leaders responsible for enforcement at
71-
${options.email}.
71+
${options.email.github}.
7272
All complaints will be reviewed and investigated promptly and fairly.
7373
7474
All community leaders are obligated to respect the privacy and security of the
@@ -272,7 +272,7 @@ We take all security vulnerabilities seriously.
272272
If you have a vulnerability or other security issues to disclose:
273273
274274
- Thank you very much, please do!
275-
- Please send them to us by emailing \`${options.email}\`
275+
- Please send them to us by emailing \`${options.email.github}\`
276276
277277
We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions.
278278
`,

0 commit comments

Comments
 (0)