This commit is contained in:
Chris Wall 2016-10-13 19:49:45 -05:00
Родитель 28df1c01d6
Коммит d36f1bbfa0
1 изменённых файлов: 16 добавлений и 2 удалений

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

@ -54,6 +54,20 @@ let orgInstance;
// F U N C T I O N S
const getOrgInstance = function getOrgInstance(url=SALESFORCE_URL) {
if (!orgInstance) {
const match = SALESFORCE_URL_REGEX.exec(url);
if (match === null) {
throw new Error(`Invalid SALESFORCE_URL: '${url}'`);
}
SALESFORCE_URL_REGEX.lastIndex = 0; // reset
orgInstance = `${match[4]}`;
}
return orgInstance;
}
// Generate config object from given SALESFORCE_URL
const parseOrgConfigFromUrl = function parseOrgConfigFromUrl(url, type, username) {
const match = SALESFORCE_URL_REGEX.exec(url);
@ -162,7 +176,7 @@ const pushSource = function pushSource(targetOrg) {
utils.info(`[DEBUG] Push options: ${JSON.stringify(PUSH_SOURCE_OPTIONS)}`);
}
utils.info(`Pushing workspace source to Organization '${orgInstance}'...`);
utils.info(`Pushing workspace source to Organization '${getOrgInstance()}'...`);
const start = (new Date()).getTime();
return pushApi.doPush(PUSH_SOURCE_OPTIONS)
.then((result) => {
@ -202,7 +216,7 @@ const setupEnv = function setupEnv() {
.then(config.setWorkspaceOrg(SALESFORCE_ORG))
.then(() => {
if (DEBUG) {
utils.info(`[DEBUG] Set workspace Organization to ${SALESFORCE_ORG}`);
utils.info(`[DEBUG] Set workspace Organization to '${SALESFORCE_ORG}'`);
}
})
.then(writeHubConfig)