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('#')); }