Merge pull request #897 from embark-framework/bug_fix/template-downloader-branch-names

allow for '/' in branch name when handling github shortcuts
This commit is contained in:
Iuri Matias 2018-09-24 16:45:31 -04:00 committed by GitHub
commit e744a24557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -127,8 +127,9 @@ class TemplateGenerator {
getExternalProject(uri) { getExternalProject(uri) {
let url, folder; let url, folder;
if (uri.split('/').length === 2) { const regex = /^((git@)?(www\.)?github\.com\/)|(https?:\/\/)/;
//e.g embark-framework/embark if (!uri.match(regex) && uri.split('/').length >= 2) {
//e.g embark-framework/embark, embark-framework/embark#branch, embark-framework/embark#features/branch
let repoPartAndBranch = uri.split('#'); let repoPartAndBranch = uri.split('#');
let repoPart = repoPartAndBranch[0]; let repoPart = repoPartAndBranch[0];
let branchName = (repoPartAndBranch.length === 2)? repoPartAndBranch[1] : "master"; let branchName = (repoPartAndBranch.length === 2)? repoPartAndBranch[1] : "master";