@karmaniverous/get-dotenv 3.1.7 → 3.1.9
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.
|
@@ -128,7 +128,7 @@ const getDotenv = async function () {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// Log result.
|
|
131
|
-
if (log) logger(dotenv);
|
|
131
|
+
if (log) logger.log(dotenv);
|
|
132
132
|
|
|
133
133
|
// Load process.env.
|
|
134
134
|
if (loadProcess) Object.assign(process.env, dotenv);
|
|
@@ -220,7 +220,7 @@ const getDotenvSync = function () {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
// Log result.
|
|
223
|
-
if (log) logger(dotenv);
|
|
223
|
+
if (log) logger.log(dotenv);
|
|
224
224
|
|
|
225
225
|
// Load process.env.
|
|
226
226
|
if (loadProcess) Object.assign(process.env, dotenv);
|
|
@@ -116,7 +116,7 @@ const getDotenvCli = function () {
|
|
|
116
116
|
isDefault: true
|
|
117
117
|
}).hook('preSubcommand', async thisCommand => {
|
|
118
118
|
const rawOptions = thisCommand.opts();
|
|
119
|
-
if (rawOptions.debug) logger('\n*** raw cli options ***\n', {
|
|
119
|
+
if (rawOptions.debug) logger.log('\n*** raw cli options ***\n', {
|
|
120
120
|
rawOptions
|
|
121
121
|
});
|
|
122
122
|
|
|
@@ -146,14 +146,14 @@ const getDotenvCli = function () {
|
|
|
146
146
|
cliOptions.excludePublic = resolveExclusionAll(cliOptions.excludePublic, excludePublicOff, excludePublic);
|
|
147
147
|
cliOptions.log = resolveExclusion(cliOptions.log, logOff, log);
|
|
148
148
|
cliOptions.loadProcess = resolveExclusion(cliOptions.loadProcess, loadProcessOff, loadProcess);
|
|
149
|
-
if (cliOptions.debug) logger('\n*** cli options after default resolution ***\n', {
|
|
149
|
+
if (cliOptions.debug) logger.log('\n*** cli options after default resolution ***\n', {
|
|
150
150
|
cliOptions
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
// Execute pre-hook.
|
|
154
154
|
if (preHook) {
|
|
155
155
|
cliOptions = (await preHook(cliOptions)) ?? cliOptions;
|
|
156
|
-
if (cliOptions.debug) logger('\n*** cli options after pre-hook ***\n', cliOptions);
|
|
156
|
+
if (cliOptions.debug) logger.log('\n*** cli options after pre-hook ***\n', cliOptions);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
// Get getdotenv options from parent command.
|
|
@@ -163,7 +163,7 @@ const getDotenvCli = function () {
|
|
|
163
163
|
...parentGetdotenvOptions,
|
|
164
164
|
...cliGetdotenvOptions
|
|
165
165
|
};
|
|
166
|
-
if (cliOptions.debug) logger('\n*** getdotenv option resolution ***\n', {
|
|
166
|
+
if (cliOptions.debug) logger.log('\n*** getdotenv option resolution ***\n', {
|
|
167
167
|
parentGetdotenvOptions,
|
|
168
168
|
cliGetdotenvOptions,
|
|
169
169
|
getdotenvOptions
|
|
@@ -174,13 +174,13 @@ const getDotenvCli = function () {
|
|
|
174
174
|
...getdotenvOptions,
|
|
175
175
|
logger
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
const dotenv = await (0, _getDotenv.getDotenv)(getdotenvOptions);
|
|
178
178
|
if (cliOptions.debug) console.log('\n*** resulting dotenv values ***\n', {
|
|
179
|
-
dotenv
|
|
179
|
+
dotenv
|
|
180
180
|
});
|
|
181
181
|
|
|
182
182
|
// Execute post-hook.
|
|
183
|
-
if (postHook) await postHook(
|
|
183
|
+
if (postHook) await postHook(dotenv);
|
|
184
184
|
|
|
185
185
|
// Execute shell command.
|
|
186
186
|
if (command) await (0, _execa.execaCommand)(command.replace(/ /g, '\\ '), {
|
package/lib/getDotenv.js
CHANGED
|
@@ -145,7 +145,7 @@ export const getDotenv = async (options = {}) => {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// Log result.
|
|
148
|
-
if (log) logger(dotenv);
|
|
148
|
+
if (log) logger.log(dotenv);
|
|
149
149
|
|
|
150
150
|
// Load process.env.
|
|
151
151
|
if (loadProcess) Object.assign(process.env, dotenv);
|
|
@@ -256,7 +256,7 @@ export const getDotenvSync = (options = {}) => {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
// Log result.
|
|
259
|
-
if (log) logger(dotenv);
|
|
259
|
+
if (log) logger.log(dotenv);
|
|
260
260
|
|
|
261
261
|
// Load process.env.
|
|
262
262
|
if (loadProcess) Object.assign(process.env, dotenv);
|
package/lib/getDotenvCli.js
CHANGED
|
@@ -340,7 +340,7 @@ export const getDotenvCli = ({
|
|
|
340
340
|
const rawOptions = thisCommand.opts();
|
|
341
341
|
|
|
342
342
|
if (rawOptions.debug)
|
|
343
|
-
logger('\n*** raw cli options ***\n', { rawOptions });
|
|
343
|
+
logger.log('\n*** raw cli options ***\n', { rawOptions });
|
|
344
344
|
|
|
345
345
|
// Load options.
|
|
346
346
|
let {
|
|
@@ -409,7 +409,7 @@ export const getDotenvCli = ({
|
|
|
409
409
|
);
|
|
410
410
|
|
|
411
411
|
if (cliOptions.debug)
|
|
412
|
-
logger('\n*** cli options after default resolution ***\n', {
|
|
412
|
+
logger.log('\n*** cli options after default resolution ***\n', {
|
|
413
413
|
cliOptions,
|
|
414
414
|
});
|
|
415
415
|
|
|
@@ -417,7 +417,7 @@ export const getDotenvCli = ({
|
|
|
417
417
|
if (preHook) {
|
|
418
418
|
cliOptions = (await preHook(cliOptions)) ?? cliOptions;
|
|
419
419
|
if (cliOptions.debug)
|
|
420
|
-
logger('\n*** cli options after pre-hook ***\n', cliOptions);
|
|
420
|
+
logger.log('\n*** cli options after pre-hook ***\n', cliOptions);
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
// Get getdotenv options from parent command.
|
|
@@ -433,7 +433,7 @@ export const getDotenvCli = ({
|
|
|
433
433
|
};
|
|
434
434
|
|
|
435
435
|
if (cliOptions.debug)
|
|
436
|
-
logger('\n*** getdotenv option resolution ***\n', {
|
|
436
|
+
logger.log('\n*** getdotenv option resolution ***\n', {
|
|
437
437
|
parentGetdotenvOptions,
|
|
438
438
|
cliGetdotenvOptions,
|
|
439
439
|
getdotenvOptions,
|
|
@@ -444,15 +444,14 @@ export const getDotenvCli = ({
|
|
|
444
444
|
...getdotenvOptions,
|
|
445
445
|
logger,
|
|
446
446
|
};
|
|
447
|
-
|
|
447
|
+
|
|
448
|
+
const dotenv = await getDotenv(getdotenvOptions);
|
|
448
449
|
|
|
449
450
|
if (cliOptions.debug)
|
|
450
|
-
console.log('\n*** resulting dotenv values ***\n', {
|
|
451
|
-
dotenv: thisCommand.dotenv,
|
|
452
|
-
});
|
|
451
|
+
console.log('\n*** resulting dotenv values ***\n', { dotenv });
|
|
453
452
|
|
|
454
453
|
// Execute post-hook.
|
|
455
|
-
if (postHook) await postHook(
|
|
454
|
+
if (postHook) await postHook(dotenv);
|
|
456
455
|
|
|
457
456
|
// Execute shell command.
|
|
458
457
|
if (command)
|