@dotenvx/dotenvx 0.6.6 → 0.6.7
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/package.json +1 -1
- package/src/cli/dotenvx.js +5 -2
- package/src/cli/examples.js +10 -7
package/package.json
CHANGED
package/src/cli/dotenvx.js
CHANGED
|
@@ -54,7 +54,7 @@ program
|
|
|
54
54
|
|
|
55
55
|
// dotenvx run -- node index.js
|
|
56
56
|
program.command('run')
|
|
57
|
-
.description('inject env at runtime
|
|
57
|
+
.description('inject env at runtime [dotenvx run -- your-command-here]')
|
|
58
58
|
.addHelpText('after', examples.run)
|
|
59
59
|
.option('-f, --env-file <paths...>', 'path(s) to your env file(s)', '.env')
|
|
60
60
|
.option('-o, --overload', 'override existing env variables')
|
|
@@ -159,7 +159,10 @@ program.command('run')
|
|
|
159
159
|
// Extract command and arguments after '--'
|
|
160
160
|
const commandIndex = process.argv.indexOf('--')
|
|
161
161
|
if (commandIndex === -1 || commandIndex === process.argv.length - 1) {
|
|
162
|
-
logger.error('
|
|
162
|
+
logger.error('missing command after [dotenvx run --]')
|
|
163
|
+
logger.error('')
|
|
164
|
+
logger.error(' get help: [dotenvx help run]')
|
|
165
|
+
logger.error(' or try: [dotenvx run -- npm run dev]')
|
|
163
166
|
process.exit(1)
|
|
164
167
|
} else {
|
|
165
168
|
const subCommand = process.argv.slice(commandIndex + 1)
|
package/src/cli/examples.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
const run = function () {
|
|
2
2
|
return `
|
|
3
|
-
|
|
3
|
+
Examples:
|
|
4
4
|
|
|
5
|
-
\`\`\`
|
|
6
|
-
$ dotenvx run --
|
|
5
|
+
\`\`\`
|
|
6
|
+
$ dotenvx run -- npm run dev
|
|
7
|
+
$ dotenvx run -- flask --app index run
|
|
8
|
+
$ dotenvx run -- php artisan serve
|
|
9
|
+
$ dotenvx run -- bin/rails s
|
|
7
10
|
\`\`\`
|
|
8
11
|
|
|
9
12
|
Try it:
|
|
10
13
|
|
|
11
|
-
\`\`\`
|
|
14
|
+
\`\`\`
|
|
12
15
|
$ echo "HELLO=World" > .env
|
|
13
16
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
14
17
|
|
|
@@ -21,15 +24,15 @@ Try it:
|
|
|
21
24
|
|
|
22
25
|
const encrypt = function () {
|
|
23
26
|
return `
|
|
24
|
-
|
|
27
|
+
Examples:
|
|
25
28
|
|
|
26
|
-
\`\`\`
|
|
29
|
+
\`\`\`
|
|
27
30
|
$ dotenvx encrypt
|
|
28
31
|
\`\`\`
|
|
29
32
|
|
|
30
33
|
Try it:
|
|
31
34
|
|
|
32
|
-
\`\`\`
|
|
35
|
+
\`\`\`
|
|
33
36
|
$ echo "HELLO=World" > .env
|
|
34
37
|
$ echo "HELLO=production" > .env.production
|
|
35
38
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|