diff --git a/package-lock.json b/package-lock.json index d57b644d..9259b00c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "superplate-cli", - "version": "1.17.3", + "version": "1.17.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "superplate-cli", - "version": "1.17.3", + "version": "1.17.4", "license": "MIT", "dependencies": { "chalk": "^4.1.0", diff --git a/package.json b/package.json index d2f0de59..318b42df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superplate-cli", - "version": "1.17.3", + "version": "1.17.4", "description": "The frontend boilerplate with superpowers", "license": "MIT", "repository": { diff --git a/src/saofile.ts b/src/saofile.ts index e8ef9ec5..1eb82618 100644 --- a/src/saofile.ts +++ b/src/saofile.ts @@ -169,31 +169,35 @@ const saoConfig: GeneratorConfig = { process.exit(1); } - const result: { userEmail: string } = await prompt({ + const emailPromptResult: { userEmail: string } = await prompt({ type: "input", name: "userEmail", message: "Mind sharing your email? (We reach out to developers for free priority support, events, and SWAG kits. We never spam.)", required: false, - skip: () => { - return !sao.opts.extras.projectType.includes("refine"); - }, + skip: () => !sao.opts.extras.projectType.includes("refine"), }); let projectId = ""; - if (result.userEmail) { - const res = await fetch("https://telemetry.refine.dev/projects", { - method: "POST", - body: JSON.stringify({ - email: result.userEmail, - }), - headers: { "Content-Type": "application/json" }, - }); + try { + const createProjectResponse = await fetch( + "https://telemetry.refine.dev/projects", + { + method: "POST", + body: JSON.stringify({ + email: emailPromptResult.userEmail, + }), + headers: { "Content-Type": "application/json" }, + }, + ); - const data = await res.json(); + const createProjectResponseData = + await createProjectResponse.json(); - projectId = data.projectId; + projectId = createProjectResponseData.projectId; + } catch (_e) { + // } sao.opts.outDir = sao.opts.outDir + "/" + appName;