@extrahorizon/exh-cli 1.9.0-dev-86-1fadbca → 1.9.0-dev-91-ec8a18d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,7 +31,7 @@ async function zipFileFromDirectory(path) {
|
|
|
31
31
|
exports.zipFileFromDirectory = zipFileFromDirectory;
|
|
32
32
|
async function syncFunctionUser(sdk, data) {
|
|
33
33
|
const { taskName, targetEmail, targetPermissions } = data;
|
|
34
|
-
const email = targetEmail || `exh.tasks+${taskName}@extrahorizon.com
|
|
34
|
+
const email = (targetEmail || `exh.tasks+${taskName}@extrahorizon.com`).toLowerCase();
|
|
35
35
|
validateEmail(email);
|
|
36
36
|
const password = `0Oo-${(0, uuid_1.v4)()}`;
|
|
37
37
|
const roleName = `exh.tasks.${taskName}`;
|
package/build/helpers/util.js
CHANGED
|
@@ -38,21 +38,20 @@ async function asyncExec(cmd) {
|
|
|
38
38
|
exports.asyncExec = asyncExec;
|
|
39
39
|
function loadAndAssertCredentials() {
|
|
40
40
|
const credentials = {};
|
|
41
|
-
let credentialsFile;
|
|
42
41
|
let errorMessage = '';
|
|
43
42
|
try {
|
|
44
|
-
credentialsFile = fs.readFileSync(constants_1.EXH_CONFIG_FILE, 'utf-8');
|
|
43
|
+
const credentialsFile = fs.readFileSync(constants_1.EXH_CONFIG_FILE, 'utf-8');
|
|
44
|
+
const credentialFileLines = credentialsFile.split(/\r?\n/);
|
|
45
|
+
for (const credentialFileLine of credentialFileLines) {
|
|
46
|
+
const [key, value] = credentialFileLine.split('=');
|
|
47
|
+
if (key && value) {
|
|
48
|
+
credentials[key.trim()] = value.trim();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
catch (e) {
|
|
47
53
|
errorMessage += 'Couldn\'t open ~/.exh/credentials. ';
|
|
48
54
|
}
|
|
49
|
-
const credentialFileLines = credentialsFile.split(/\r?\n/);
|
|
50
|
-
for (const credentialFileLine of credentialFileLines) {
|
|
51
|
-
const [key, value] = credentialFileLine.split('=');
|
|
52
|
-
if (key && value) {
|
|
53
|
-
credentials[key.trim()] = value.trim();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
55
|
const requiredEnvVariables = ['API_HOST', 'API_OAUTH_CONSUMER_KEY', 'API_OAUTH_CONSUMER_SECRET', 'API_OAUTH_TOKEN', 'API_OAUTH_TOKEN_SECRET'];
|
|
57
56
|
for (const key of requiredEnvVariables) {
|
|
58
57
|
if (credentials[key] && !process.env[key]) {
|