From cc08a16ae3c3fe32f36e0626671cf8a033fa731a Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Wed, 10 Oct 2018 11:18:36 -0500 Subject: [PATCH] calc a . branch for unqualified template names doesn't calc a branch if a url/shortcut is supplied that hostedGitInfo knows how to parse only does this for unqualified names if a committish isn't supplied, i.e. doesn't override '#develop' in 'typescript#develop' --- lib/utils/template_generator.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/utils/template_generator.js b/lib/utils/template_generator.js index 85582be2..2d884c05 100644 --- a/lib/utils/template_generator.js +++ b/lib/utils/template_generator.js @@ -1,6 +1,7 @@ let fs = require('../core/fs.js'); let hostedGitInfo = require('hosted-git-info'); let utils = require('./utils.js'); +let semver = require('semver'); class TemplateGenerator { constructor(templateName) { @@ -104,6 +105,10 @@ class TemplateGenerator { hgi = hostedGitInfo.fromUrl(uri); if (!hgi || hgi.user.includes('#')) { let templateAndBranch = uri.split('#'); + if (templateAndBranch.length === 1) { + let embarkVersion = semver(require('../../package.json').version); + templateAndBranch.push(`${embarkVersion.major}.${embarkVersion.minor}`); + } templateAndBranch[0] = `embark-framework/embark-${templateAndBranch[0]}-template`; hgi = hostedGitInfo.fromUrl(templateAndBranch.join('#')); }