Skip to content

Commit 045d3dc

Browse files
committed
fix lint violations.
1 parent 39f5ac9 commit 045d3dc

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

source/git-util.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ exports.currentBranch = async () => {
5555
};
5656

5757
exports.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

136136
exports.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

157159
exports.verifyTagDoesNotExistOnRemote = async tagName => {
158160
if (await exports.tagExistsOnRemote(tagName)) {

0 commit comments

Comments
 (0)