Skip to content

Commit 26e0090

Browse files
authored
add some error handling around common issues (#16387)
1 parent c39f624 commit 26e0090

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

script/graphql/update-files.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ const processUpcomingChanges = require('./utils/process-upcoming-changes')
1515
const processSchemas = require('./utils/process-schemas')
1616
const prerenderObjects = require('./utils/prerender-objects')
1717

18+
// check for required PAT
19+
if (!process.env.GITHUB_TOKEN) {
20+
console.error('Error! You must have a GITHUB_TOKEN set in an .env file to run this script.')
21+
process.exit(1)
22+
}
23+
24+
// check for required Ruby gems (see note below about why this is needed)
25+
try {
26+
execSync('gem which graphql')
27+
} catch (err) {
28+
console.error('\nYou need to run: bundle install')
29+
process.exit(1)
30+
}
31+
1832
// TODO this step is only required as long as we support GHE versions *OLDER THAN* 2.21
1933
// as soon as 2.20 is deprecated on 2021-02-11, we can remove all graphql-ruby filtering
2034
const removeHiddenMembersScript = path.join(__dirname, './utils/remove-hidden-schema-members.rb')

0 commit comments

Comments
 (0)