Skip to content

Commit 141fbab

Browse files
committed
Condensed getLatestCommitHash()
1 parent fcbc28d commit 141fbab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/bump/bump-utils.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export async function generateSRIhash({ resURL, algorithm = 'sha256', verbose =
7272
export async function getLatestCommitHash({ repo, path = '', verbose = true } = {}) {
7373
if (!repo) throw new Error(`'repo' option required by getLatestCommitHash()`)
7474
const endpoint = `https://api.github.com/repos/${repo}/commits`,
75-
latestCommitHash = (await (await fetch(`${endpoint}?path=${ path || '' }`)).json())[0]?.sha
75+
latestCommitHash = (await (await fetch(`${endpoint}?path=${path}`)).json())[0]?.sha
7676
if (verbose && latestCommitHash) this.log.hash(`${latestCommitHash}\n`)
7777
return latestCommitHash
7878
}

0 commit comments

Comments
 (0)