fix(apply): add BITPAY_EXTERNAL_SERVICES_CONFIG_LOCATION var to apply task

This commit is contained in:
Jason Dreyzehner 2016-10-21 13:17:58 -04:00
commit fbe24eab78
2 changed files with 9 additions and 5 deletions

View file

@ -137,10 +137,12 @@ On success, the Chrome extension will be located at: `browser-extensions/chrome/
### Enable External Services ### Enable External Services
To enable external services, set the `COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION` environment variable to the location of your configuration before running the `apply` task. To enable external services, set the `COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION` or `BITPAY_EXTERNAL_SERVICES_CONFIG_LOCATION` environment variable to the location of your configuration before running the `apply` task.
```sh ```sh
export COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION="~/.copay/externalServices.json" COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION="~/.copay/externalServices.json" && npm run apply:copay
# or
BITPAY_EXTERNAL_SERVICES_CONFIG_LOCATION="~/.bitpay/externalServices.json" && npm run apply:bitpay
``` ```
## About Copay ## About Copay

View file

@ -82,9 +82,11 @@ fs.writeFileSync('../appConfig.json', configBlob, 'utf8');
//////////////// ////////////////
var externalServices; var externalServices;
try { try {
console.log('Looking for COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION...'); var confName = configDir.toUpperCase();
if(typeof process.env.COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION !== 'undefined') { externalServicesConf = confName + '_EXTERNAL_SERVICES_CONFIG_LOCATION';
var location = process.env.COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION; console.log('Looking for ' + externalServicesConf + '...');
if(typeof process.env[externalServicesConf] !== 'undefined') {
var location = process.env[externalServicesConf]
if(location.charAt(0) === '~') { if(location.charAt(0) === '~') {
location = location.replace(/^\~/, process.env.HOME || process.env.USERPROFILE); location = location.replace(/^\~/, process.env.HOME || process.env.USERPROFILE);
} }