calc a <major>.<minor> 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'
This commit is contained in:
parent
d50ae8c649
commit
cc08a16ae3
|
@ -1,6 +1,7 @@
|
||||||
let fs = require('../core/fs.js');
|
let fs = require('../core/fs.js');
|
||||||
let hostedGitInfo = require('hosted-git-info');
|
let hostedGitInfo = require('hosted-git-info');
|
||||||
let utils = require('./utils.js');
|
let utils = require('./utils.js');
|
||||||
|
let semver = require('semver');
|
||||||
|
|
||||||
class TemplateGenerator {
|
class TemplateGenerator {
|
||||||
constructor(templateName) {
|
constructor(templateName) {
|
||||||
|
@ -104,6 +105,10 @@ class TemplateGenerator {
|
||||||
hgi = hostedGitInfo.fromUrl(uri);
|
hgi = hostedGitInfo.fromUrl(uri);
|
||||||
if (!hgi || hgi.user.includes('#')) {
|
if (!hgi || hgi.user.includes('#')) {
|
||||||
let templateAndBranch = uri.split('#');
|
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`;
|
templateAndBranch[0] = `embark-framework/embark-${templateAndBranch[0]}-template`;
|
||||||
hgi = hostedGitInfo.fromUrl(templateAndBranch.join('#'));
|
hgi = hostedGitInfo.fromUrl(templateAndBranch.join('#'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue