diff --git a/lib/utils/template_generator.js b/lib/utils/template_generator.js index 3cc73a60..1598a2d2 100644 --- a/lib/utils/template_generator.js +++ b/lib/utils/template_generator.js @@ -93,10 +93,10 @@ class TemplateGenerator { let url, folder, hgi; try { hgi = hostedGitInfo.fromUrl(uri); - if (!hgi) { - let x = uri.split('#'); - x[0] = `embark-framework/embark-${x[0]}-template`; - hgi = hostedGitInfo.fromUrl(x.join('#')); + if (!hgi || hgi.user.includes('#')) { + let templateAndBranch = uri.split('#'); + templateAndBranch[0] = `embark-framework/embark-${templateAndBranch[0]}-template`; + hgi = hostedGitInfo.fromUrl(templateAndBranch.join('#')); } if(!hgi) { throw new Error(); } url = hgi.tarball();