Skip to content

Commit 29e2006

Browse files
authored
exit with logging message (#19137)
1 parent d9c336f commit 29e2006

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

script/update-enterprise-dates.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ main()
2323

2424
async function main () {
2525
// send owner, repo, ref, path
26-
const rawDates = JSON.parse(await getContents('github', 'enterprise-releases', 'master', 'releases.json'))
26+
let rawDates = []
27+
try {
28+
rawDates = JSON.parse(await getContents('github', 'enterprise-releases', 'master', 'releases.json'))
29+
} catch {
30+
console.log('Failed to get the https://github.com/github/enterprise-releases/blob/master/releases.json content. Check that your token has the correct permissions.')
31+
process.exit(1)
32+
}
2733

2834
const formattedDates = {}
2935
Object.entries(rawDates).forEach(([releaseNumber, releaseObject]) => {

0 commit comments

Comments
 (0)