build: handle origin/X branch formats

This commit is contained in:
Samuel Attard
2019-12-18 14:02:38 -08:00
parent acd2eabdfd
commit 606ca98df0

View File

@@ -63,7 +63,7 @@ async function getCurrentBranch (gitDir) {
'--remote'
], gitDir)).split('\n')
branch = branches.filter(b => b.trim() === 'master' || b.trim().match(/^[0-9]+-[0-9]+-x$/) || b.trim().match(/^[0-9]+-x-y$/))[0]
branch = branches.filter(b => b.trim() === 'master' || b.trim().match(/[0-9]+-[0-9]+-x$/) || b.trim().match(/[0-9]+-x-y$/))[0]
if (!branch) {
console.log(`${fail} no release branch exists for this ref`)
process.exit(1)