Merge pull request #12 from heroku/cwall/not-require-salsforce-url

Skip writing user config from SALESFORCE_URL
This commit is contained in:
Chris Wall 2016-09-28 09:56:20 -05:00 коммит произвёл GitHub
Родитель b51d01195f e9b154b1a8
Коммит c3360cdf84
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -20,7 +20,9 @@ const HEROKU_APP_NAME = _.getEnvVarValue('HEROKU_APP_NAME', false, 'Salesforce B
const IS_SALESFORCE_WORKSPACE = _.getEnvVarValue('SALESFORCE_WORKSPACE', false, true, true); // set by bin/compile
const SALESFORCE_SRC_PATH = _.getEnvVarValue('SALESFORCE_SRC_PATH', false, 'salesforce/src');
const SALESFORCE_URL_CONFIG_VAR_NAME = 'SALESFORCE_URL';
// custom URL provided by Salesforce Add-on that enables connectivity to org
// custom URL provided by Salesforce Add-on that enables connectivity to org.
// if false, app is telling us that a Salesforce Add-on created org is not
// need, eg Test Runner is controlling what/how orgs are spun-up
const SALESFORCE_URL = _.getEnvVarValue(SALESFORCE_URL_CONFIG_VAR_NAME, true);
const SALESFORCE_HUB_URL_CONFIG_VAR_NAME = 'SALESFORCE_HUB_URL';
const SALESFORCE_DEPLOY_DIR = _.getEnvVarValue('SALESFORCE_DEPLOY_DIR', false, '.salesforce'); // set by bin/compile
@ -137,12 +139,21 @@ const parseOrgConfigFromUrl = function parseOrgConfigFromUrl(url, type, username
};
};
// Write workspace org config from SALESFORCE_URL to .appcloud to be consumed by appcloud module
// Write workspace org config from SALESFORCE_URL to .appcloud to be consumed by appcloud module.
// If 'false', app is telling us that SALESFORCE_URL is not required.
const writeOrgConfig = function writeOrgConfig() {
if (DEBUG) {
_.info(`[DEBUG] ${SALESFORCE_URL_CONFIG_VAR_NAME}: ${SALESFORCE_URL}`);
}
if (SALESFORCE_URL === 'false') {
if (VERBOSE) {
_.info(`Skip writing user org config: ${SALESFORCE_URL_CONFIG_VAR_NAME} was not required.`);
}
return Promise.resolve();
}
orgConfig = parseOrgConfigFromUrl(SALESFORCE_URL, 'workspace');
if (DEBUG) {