Skip to content

Commit

Permalink
feat(prompts): guard author info parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyDoey committed Mar 27, 2024
1 parent ff21317 commit 1b98512
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/cli/src/lib/make/prompts/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,6 @@ export async function bedframePrompts(
},
)

const parseAuthor = (author: string) => {
const [name, email, url] = author.split(',')
return {
name: name.trim(),
email: email.trim(),
url: url.trim(),
}
}

if (options.name) {
extensionResponse.name = formatTargetDir(options.name)
}
Expand All @@ -374,7 +365,12 @@ export async function bedframePrompts(
extensionResponse.description = options.description
}
if (options.author) {
extensionResponse.author = parseAuthor(options.author)
const [name, email, url] = options.author.split(',')
extensionResponse.author = {
name: name.trim(),
email: email.trim(),
url: url.trim(),
}
}
if (options.license) {
extensionResponse.license = options.license
Expand Down

0 comments on commit 1b98512

Please sign in to comment.