@dotenvx/dotenvx 1.6.4 → 1.6.5

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/CHANGELOG.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.6.4...main)
5
+ ## [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.6.5...main)
6
+
7
+ ## 1.6.5
8
+
9
+ ### Changed
10
+
11
+ * 🐞 patch `chomp` for interpolation. strip ending newline (was stripping first found newline) ([#322](https://github.com/dotenvx/dotenvx/pull/322))
6
12
 
7
13
  ## 1.6.4
8
14
 
package/README.md CHANGED
@@ -267,6 +267,16 @@ More examples
267
267
  Hello World
268
268
  ```
269
269
 
270
+ </details>
271
+ * <details><summary>Fish 🐠</summary><br>
272
+
273
+ ```sh
274
+ $ echo "HELLO=World" > .env
275
+
276
+ $ dotenvx run --quiet -- sh -c 'echo Hello $HELLO'
277
+ Hello World
278
+ ```
279
+
270
280
  </details>
271
281
  * <details><summary>Cron ⏰</summary><br>
272
282
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.4",
2
+ "version": "1.6.5",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -108,13 +108,32 @@ const decryptAction = require('./actions/decrypt')
108
108
  program.command('decrypt')
109
109
  .description('convert encrypted .env file(s) to plain .env file(s)')
110
110
  .option('-f, --env-file <paths...>', 'path(s) to your env file(s)')
111
- .option('-k, --key <keys...>', 'keys(s) to encrypt (default: all keys in file)')
111
+ .option('-k, --key <keys...>', 'keys(s) to decrypt (default: all keys in file)')
112
112
  .option('--stdout', 'send to stdout')
113
113
  .action(decryptAction)
114
114
 
115
+ // dotenvx help
116
+ program.command('help [command]')
117
+ .description('display help for command')
118
+ .action((command) => {
119
+ if (command) {
120
+ const subCommand = program.commands.find(c => c.name() === command)
121
+ if (subCommand) {
122
+ subCommand.outputHelp()
123
+ } else {
124
+ program.outputHelp()
125
+ }
126
+ } else {
127
+ program.outputHelp()
128
+ }
129
+ })
130
+
115
131
  // dotenvx ext
116
132
  program.addCommand(require('./commands/ext'))
117
133
 
134
+ //
135
+ // DEPRECATED or MOVED
136
+ //
118
137
  const lsAction = require('./actions/ext/ls')
119
138
  program.command('ls')
120
139
  .description('DEPRECATED: moved to [dotenvx ext ls]')
@@ -137,7 +156,6 @@ program.command('genexample')
137
156
  genexampleAction.apply(this, args)
138
157
  })
139
158
 
140
- // dotenvx gitignore
141
159
  const gitignoreAction = require('./actions/ext/gitignore')
142
160
  program.command('gitignore')
143
161
  .description('DEPRECATED: moved to [dotenvx ext gitignore]')
@@ -148,7 +166,6 @@ program.command('gitignore')
148
166
  gitignoreAction.apply(this, args)
149
167
  })
150
168
 
151
- // dotenvx prebuild
152
169
  const prebuildAction = require('./actions/ext/prebuild')
153
170
  program.command('prebuild')
154
171
  .description('DEPRECATED: moved to [dotenvx ext prebuild]')
@@ -159,7 +176,6 @@ program.command('prebuild')
159
176
  prebuildAction.apply(this, args)
160
177
  })
161
178
 
162
- // dotenvx precommit
163
179
  const precommitAction = require('./actions/ext/precommit')
164
180
  program.command('precommit')
165
181
  .description('DEPRECATED: moved to [dotenvx ext precommit]')
@@ -171,7 +187,6 @@ program.command('precommit')
171
187
  precommitAction.apply(this, args)
172
188
  })
173
189
 
174
- // dotenvx scan
175
190
  const scanAction = require('./actions/ext/scan')
176
191
  program.command('scan')
177
192
  .description('DEPRECATED: moved to [dotenvx ext scan]')
@@ -181,28 +196,13 @@ program.command('scan')
181
196
  scanAction.apply(this, args)
182
197
  })
183
198
 
184
- program.command('help [command]')
185
- .description('display help for command')
186
- .action((command) => {
187
- if (command) {
188
- const subCommand = program.commands.find(c => c.name() === command)
189
- if (subCommand) {
190
- subCommand.outputHelp()
191
- } else {
192
- program.outputHelp()
193
- }
194
- } else {
195
- program.outputHelp()
196
- }
197
- })
198
-
199
199
  // overide helpInformation to hide DEPRECATED commands
200
200
  program.helpInformation = function () {
201
201
  const originalHelp = Command.prototype.helpInformation.call(this)
202
202
  const lines = originalHelp.split('\n')
203
203
 
204
204
  // Filter out the hidden command from the help output
205
- const filteredLines = lines.filter(line => !line.includes('DEPRECATED'))
205
+ const filteredLines = lines.filter(line => !line.includes('DEPRECATED') && !line.includes('help [command]'))
206
206
 
207
207
  return filteredLines.join('\n')
208
208
  }
@@ -1,7 +1,7 @@
1
1
  const { execSync } = require('child_process')
2
2
 
3
3
  function _chomp (value) {
4
- return value.replace(/\r?\n|\r/, '')
4
+ return value.replace(/[\r\n]+$/, '')
5
5
  }
6
6
 
7
7
  function interpolate (value, processEnv, parsed) {