fix(create-medusa-app): Don't allow dot in project name (#13042)
This commit is contained in:
1 parent
0d8c2c4056
commit
909fc4c127
1 file changed
+18
@@ -57,6 +57,16 @@ export class ProjectCreatorFactory {
|
|||||||
type: "warn",
|
type: "warn",
|
||||||
})
|
})
|
||||||
askProjectName = true
|
askProjectName = true
|
||||||
|
} else if (args[0].includes(".")) {
|
||||||
|
// We don't allow projects to have a dot in the name, as this causes issues for
|
||||||
|
// for MikroORM path resolutions.
|
||||||
|
logMessage({
|
||||||
|
message: `Project names cannot contain a dot (.) character. Please enter a different ${
|
||||||
|
isPlugin ? "plugin" : "project"
|
||||||
|
} name.`,
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
askProjectName = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,6 +90,14 @@ async function askForProjectName(
|
|||||||
return slugify(input).toLowerCase()
|
return slugify(input).toLowerCase()
|
||||||
},
|
},
|
||||||
validate: (input) => {
|
validate: (input) => {
|
||||||
|
// We don't allow projects to have a dot in the name, as this causes issues for
|
||||||
|
// for MikroORM path resolutions.
|
||||||
|
if (input.includes(".")) {
|
||||||
|
return `Project names cannot contain a dot (.) character. Please enter a different ${
|
||||||
|
isPlugin ? "plugin" : "project"
|
||||||
|
} name.`
|
||||||
|
}
|
||||||
|
|
||||||
if (!input.length) {
|
if (!input.length) {
|
||||||
return `Please enter a ${isPlugin ? "plugin" : "project"} name`
|
return `Please enter a ${isPlugin ? "plugin" : "project"} name`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user