diff --git a/README.md b/README.md index 1643e2ad4..ee4d4007f 100644 --- a/README.md +++ b/README.md @@ -140,9 +140,9 @@ On success, the Chrome extension will be located at: `browser-extensions/chrome/ 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 -COPAY_EXTERNAL_SERVICES_CONFIG_LOCATION="~/.copay/externalServices.json" && npm run apply:copay +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 +BITPAY_EXTERNAL_SERVICES_CONFIG_LOCATION="~/.bitpay/externalServices.json" npm run apply:bitpay ``` ## About Copay diff --git a/app-template/apply.js b/app-template/apply.js index 7cad2bccd..2f0015e34 100755 --- a/app-template/apply.js +++ b/app-template/apply.js @@ -83,7 +83,7 @@ fs.writeFileSync('../appConfig.json', configBlob, 'utf8'); var externalServices; try { var confName = configDir.toUpperCase(); - externalServicesConf = confName + '_EXTERNAL_SERVICES_CONFIG_LOCATION'; + var externalServicesConf = confName + '_EXTERNAL_SERVICES_CONFIG_LOCATION'; console.log('Looking for ' + externalServicesConf + '...'); if(typeof process.env[externalServicesConf] !== 'undefined') { var location = process.env[externalServicesConf] @@ -93,8 +93,11 @@ try { console.log('Found at: ' + location); console.log('Copying ' + location + ' to root'); externalServices = fs.readFileSync(location, 'utf8'); + } else { + throw externalServicesConf + ' environment variable not set.'; } } catch(err) { + console.log(err); externalServices = '{}'; console.log('External services not configured'); }