Skip to content

Commit

Permalink
fix: swap CI env variable for require.main
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanson-nr committed Jun 23, 2021
1 parent 7780b79 commit ca72aab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"build:production": "GATSBY_NEWRELIC_ENV=production gatsby build",
"build:staging": "GATSBY_NEWRELIC_ENV=staging gatsby build",
"build:related-content": "BUILD_RELATED_CONTENT=true yarn run build:production",
"fetch-observability-packs": "CI=true node ./scripts/actions/fetch-observability-packs.js",
"fetch-observability-packs": "node ./scripts/actions/fetch-observability-packs.js",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"start": "yarn run develop",
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/fetch-observability-packs.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ const main = async (query, url, token) => {
console.log(
'No packs were returned from the api, check the logs for errors.'
);
if (process.env.CI) {
if (require.main === module) {
process.exit(1);
}
}
};

if (process.env.CI) {
if (require.main === module) {
validateEnvVars();
main(packQuery, NR_API_URL, NR_API_TOKEN);
}
Expand Down

0 comments on commit ca72aab

Please sign in to comment.