Skip to content

Commit

Permalink
Fix env variable to use upper case (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeetha5491 authored Sep 26, 2023
1 parent 2f238bd commit 41ad80e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/hooks/utils/hook-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ async function initEventsSdk (projectConfig) {
* @returns {object} Object containing mapping of provider metadata to provider id
*/
function getProviderMetadataToProviderIdMapping () {
if (!process.env.AIO_events_providermetadata_to_provider_mapping) {
console.log(process.env)
if (!process.env.AIO_EVENTS_PROVIDERMETADATA_TO_PROVIDER_MAPPING) {
throw new Error('No environment variables for provider metadata to provider id mappings found.')
}
const entries = process.env.AIO_events_providermetadata_to_provider_mapping.split(',')
const entries = process.env.AIO_EVENTS_PROVIDERMETADATA_TO_PROVIDER_MAPPING.split(',')
const providerMetadataToProviderIdMap = {}
entries.forEach(providerMetadataToProviderId => {
const tokens = providerMetadataToProviderId.split(':')
Expand Down
4 changes: 2 additions & 2 deletions test/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,14 +761,14 @@ const dotEnv = {
AIO_runtime_apihost: 'https://adobeioruntime.net',
SERVICE_API_KEY: 'serviceApiKey',
API_KEY: 'apiKey',
AIO_events_providermetadata_to_provider_mapping: 'providerMetadata1:providerId1,providerMetadata2:providerId2'
AIO_EVENTS_PROVIDERMETADATA_TO_PROVIDER_MAPPING: 'providerMetadata1:providerId1,providerMetadata2:providerId2'
}

const dotEnvMissingApiKey = {
AIO_runtime_auth: 'runtimeAuth',
AIO_runtime_namespace: 'namespace',
AIO_runtime_apihost: 'https://adobeioruntime.net',
AIO_events_providermetadata_to_provider_mapping: 'providerMetadata1:providerId1,providerMetadata2:providerId2'
AIO_EVENTS_PROVIDERMETADATA_TO_PROVIDER_MAPPING: 'providerMetadata1:providerId1,providerMetadata2:providerId2'
}

const dotEnvMissingProviderMetadataToProviderIdMapping = {
Expand Down

0 comments on commit 41ad80e

Please sign in to comment.