Skip to content

Commit

Permalink
fix: skip email prompt for apiMode (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuhanW authored Jan 5, 2024
1 parent 68959c1 commit 7922a66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superplate-cli",
"version": "1.18.1",
"version": "1.18.2",
"description": "The frontend boilerplate with superpowers",
"license": "MIT",
"repository": {
Expand Down
8 changes: 5 additions & 3 deletions src/saofile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const saoConfig: GeneratorConfig = {

const {
appName,
extras: { paths, presetAnswers, projectType },
extras: { paths, presetAnswers },
} = sao.opts;

// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down Expand Up @@ -175,7 +175,9 @@ const saoConfig: GeneratorConfig = {
message:
"Mind sharing your email? (We reach out to developers for free priority support, events, and SWAG kits. We never spam.)",
required: false,
skip: () => !sao.opts.extras.projectType?.includes?.("refine"),
skip: () =>
sao.opts.extras.apiMode ||
!sao.opts.extras.projectType?.includes?.("refine"),
});

let projectId = "";
Expand All @@ -186,7 +188,7 @@ const saoConfig: GeneratorConfig = {
{
method: "POST",
body: JSON.stringify({
email: emailPromptResult.userEmail,
email: emailPromptResult.userEmail || answers.userEmail,
}),
headers: { "Content-Type": "application/json" },
},
Expand Down

0 comments on commit 7922a66

Please sign in to comment.