File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ exports.currentBranch = async () => {
5555} ;
5656
5757exports . verifyCurrentBranchIsReleaseBranch = async releaseBranch => {
58- const expectedBranch = await exports . defaultBranch ( ) ;
58+ const expectedBranch = await exports . defaultBranch ( releaseBranch ) ;
5959 const currentBranch = await exports . currentBranch ( ) ;
6060 if ( ! expectedBranch === currentBranch ) {
6161 throw new Error ( `Not on \`${ expectedBranch } \` branch. Use --any-branch to publish anyway, or set a different release branch using --branch.` ) ;
@@ -135,24 +135,26 @@ exports.tagExistsOnRemote = async tagName => {
135135
136136exports . defaultBranch = async options => {
137137 if ( options . releaseBranch ) {
138- return releaseBranch ;
138+ return options . releaseBranch ;
139139 }
140140
141- for ( branch of [ 'main' , 'master' , 'gh-pages' ] ) {
141+ for ( const branch of [ 'main' , 'master' , 'gh-pages' ] ) {
142142 try {
143- await execa ( "git" , [
144- "show-ref" ,
145- "--verify" ,
146- "--quiet" ,
147- `refs/heads/${ branch } ` ,
143+ // eslint-disable-next-line no-await-in-loop
144+ await execa ( 'git' , [
145+ 'show-ref' ,
146+ '--verify' ,
147+ '--quiet' ,
148+ `refs/heads/${ branch } `
148149 ] ) ;
149150 return branch ;
150- } catch ( err ) { }
151+ } catch { }
151152 }
153+
152154 throw new Error (
153- " Could not determine a default branch. Please specify one via --branch."
155+ ' Could not determine a default branch. Please specify one via --branch.'
154156 ) ;
155- }
157+ } ;
156158
157159exports . verifyTagDoesNotExistOnRemote = async tagName => {
158160 if ( await exports . tagExistsOnRemote ( tagName ) ) {
You can’t perform that action at this time.
0 commit comments