@karmaniverous/get-dotenv 2.6.0 → 2.6.2
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.
package/bin/getdotenv/index.js
CHANGED
|
@@ -146,7 +146,10 @@ await getDotenv({
|
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
// Get AWS SSO credentials.
|
|
149
|
-
if (awsSsoProfile)
|
|
149
|
+
if (awsSsoProfile) {
|
|
150
|
+
const profile = dotenvExpand(awsSsoProfile);
|
|
151
|
+
if (profile) getAwsSsoCredentials(profile);
|
|
152
|
+
}
|
|
150
153
|
|
|
151
154
|
// Execute shell command.
|
|
152
155
|
if (command || program.args.length) {
|
|
@@ -43,5 +43,9 @@ const _interpolate = envValue => {
|
|
|
43
43
|
const _resolveEscapeSequences = value => {
|
|
44
44
|
return value.replace(/\\\$/g, '$');
|
|
45
45
|
};
|
|
46
|
-
const dotenvExpand = value =>
|
|
46
|
+
const dotenvExpand = value => {
|
|
47
|
+
if (!value) return;
|
|
48
|
+
const result = _resolveEscapeSequences(_interpolate(value));
|
|
49
|
+
return result.length ? result : undefined;
|
|
50
|
+
};
|
|
47
51
|
exports.dotenvExpand = dotenvExpand;
|
package/lib/dotenvExpand.js
CHANGED
|
@@ -45,5 +45,8 @@ const _resolveEscapeSequences = (value) => {
|
|
|
45
45
|
return value.replace(/\\\$/g, '$');
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export const dotenvExpand = (value) =>
|
|
49
|
-
|
|
48
|
+
export const dotenvExpand = (value) => {
|
|
49
|
+
if (!value) return;
|
|
50
|
+
const result = _resolveEscapeSequences(_interpolate(value));
|
|
51
|
+
return result.length ? result : undefined;
|
|
52
|
+
};
|