Skip to content

Commit

Permalink
adding defensive checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Mar 10, 2023
1 parent cf19db8 commit 04c6076
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/releaser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ import { updateAlgoliaSearch } from "./algolia";
import { createAssetDb } from "./db/sync-database";

export async function releaseDb(directory = '/tmp/assets') {
if(!process.env.GITHUB_TOKEN) {
throw new Error('Missing Github Token');
}

if(!process.env.ALGOLIA_APP_ID) {
throw new Error('Missing Algolia App ID');
}

if(!process.env.ALGOLIA_API_KEY) {
throw new Error('Missing Algolia API Key');
}

return Promise.all([
createAssetDb(directory),
updateAlgoliaSearch(directory)
Expand Down

0 comments on commit 04c6076

Please sign in to comment.