fix(create-medusa-app): disable opening browser (#4321)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-medusa-app": patch
|
||||
---
|
||||
|
||||
fix(create-medusa-app): disable opening browser
|
||||
@@ -34,7 +34,12 @@ type CreateOptions = {
|
||||
boilerplate?: boolean
|
||||
}
|
||||
|
||||
export default async ({ repoUrl = "", seed, boilerplate }: CreateOptions) => {
|
||||
export default async ({
|
||||
repoUrl = "",
|
||||
// TODO remove default value later
|
||||
seed = true,
|
||||
boilerplate,
|
||||
}: CreateOptions) => {
|
||||
track("CREATE_CLI")
|
||||
if (repoUrl) {
|
||||
track("STARTER_SELECTED", { starter: repoUrl })
|
||||
@@ -113,19 +118,20 @@ export default async ({ repoUrl = "", seed, boilerplate }: CreateOptions) => {
|
||||
}
|
||||
}
|
||||
|
||||
const { adminEmail } = await inquirer.prompt([
|
||||
{
|
||||
type: "input",
|
||||
name: "adminEmail",
|
||||
message: "Enter an email for your admin dashboard user",
|
||||
default: !seed && boilerplate ? "admin@medusa-test.com" : undefined,
|
||||
validate: (input) => {
|
||||
return typeof input === "string" && input.length > 0 && isEmail(input)
|
||||
? true
|
||||
: "Please enter a valid email"
|
||||
},
|
||||
},
|
||||
])
|
||||
// TODO enable this later
|
||||
// const { adminEmail } = await inquirer.prompt([
|
||||
// {
|
||||
// type: "input",
|
||||
// name: "adminEmail",
|
||||
// message: "Enter an email for your admin dashboard user",
|
||||
// default: !seed && boilerplate ? "admin@medusa-test.com" : undefined,
|
||||
// validate: (input) => {
|
||||
// return typeof input === "string" && input.length > 0 && isEmail(input)
|
||||
// ? true
|
||||
// : "Please enter a valid email"
|
||||
// },
|
||||
// },
|
||||
// ])
|
||||
|
||||
logMessage({
|
||||
message: `${emojify(
|
||||
@@ -208,9 +214,9 @@ export default async ({ repoUrl = "", seed, boilerplate }: CreateOptions) => {
|
||||
inviteToken = await prepareProject({
|
||||
directory: projectName,
|
||||
dbConnectionString,
|
||||
admin: {
|
||||
email: adminEmail,
|
||||
},
|
||||
// admin: {
|
||||
// email: adminEmail,
|
||||
// },
|
||||
seed,
|
||||
boilerplate,
|
||||
spinner,
|
||||
@@ -279,13 +285,13 @@ export default async ({ repoUrl = "", seed, boilerplate }: CreateOptions) => {
|
||||
}
|
||||
})
|
||||
|
||||
await waitOn({
|
||||
resources: ["http://localhost:9000/health"],
|
||||
}).then(async () =>
|
||||
open(
|
||||
inviteToken
|
||||
? `http://localhost:7001/invite?token=${inviteToken}&first_run=true`
|
||||
: "http://localhost:7001"
|
||||
)
|
||||
)
|
||||
// await waitOn({
|
||||
// resources: ["http://localhost:9000/health"],
|
||||
// }).then(async () =>
|
||||
// open(
|
||||
// inviteToken
|
||||
// ? `http://localhost:7001/invite?token=${inviteToken}&first_run=true`
|
||||
// : "http://localhost:7001"
|
||||
// )
|
||||
// )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user