If template name already starts with cra-template leave it alone (#7880)

This commit is contained in:
Ian Sutherland
2019-10-24 16:32:35 -07:00
committed by GitHub
parent facd8f9e44
commit 3e7391ddaf

View File

@@ -645,6 +645,8 @@ function getTemplateInstallPackage(template, originalDirectory) {
) {
// for tar.gz or alternative paths
templateToInstall = template;
} else if (template.startsWith(templateToInstall)) {
templateToInstall = template;
} else if (!template.startsWith(templateToInstall)) {
// Add prefix `cra-template` to non-prefixed templates.
templateToInstall += `-${template}`;