Skip to content

Commit

Permalink
Merge pull request #12871 from Expensify/arosiclair-ios-env-trim
Browse files Browse the repository at this point in the history
[No QA] Trim .env values for iOS
  • Loading branch information
arosiclair authored Nov 28, 2022
2 parents 7ee5ff8 + 3a5f680 commit 80bed10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CONFIG.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import lodashGet from 'lodash/get';
import get from 'lodash/get';
import {Platform} from 'react-native';
import Config from 'react-native-config';
import getPlatform from './libs/getPlatform/index';
import * as Url from './libs/Url';
import CONST from './CONST';

// react-native-config doesn't trim whitespace on iOS for some reason so we
// add a trim() call to lodashGet here to prevent headaches
const lodashGet = (config, key, defaultValue) => get(config, key, defaultValue).trim();

// Set default values to contributor friendly values to make development work out of the box without an .env file
const ENVIRONMENT = lodashGet(Config, 'ENVIRONMENT', CONST.ENVIRONMENT.DEV);
const newExpensifyURL = Url.addTrailingForwardSlash(lodashGet(Config, 'NEW_EXPENSIFY_URL', 'https://new.expensify.com/'));
Expand Down

0 comments on commit 80bed10

Please sign in to comment.