We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a75888 commit f172e4aCopy full SHA for f172e4a
src/index.ts
@@ -42,16 +42,17 @@ const dotenvRun = env({
42
files: argv.files,
43
dotenv: {
44
override: argv.override,
45
- DOTENV_KEY: argv.dotenv_key,
+ DOTENV_KEY: argv.dotenv_key ?? process.env['DOTENV_KEY'],
46
},
47
});
48
49
-const exportStatements = Object.entries(dotenvRun.raw)
50
- .map(([key, value]) => {
51
- value = JSON.stringify(value).replaceAll(/\r\n|\r|\n/g, '\n');
+const exportStatements =
+ Object.entries(dotenvRun.raw)
+ .map(([key, value]) => {
52
+ value = JSON.stringify(value).replaceAll(/\r\n|\r|\n/g, '\n');
53
- return `export ${key}=${value}`;
54
- })
55
- .join('\n');
+ return `export ${key}=${value}`;
+ })
56
+ .join('\n') + '\n';
57
58
process.stdout.write(exportStatements);
0 commit comments