envstash-cli 0.4.1 → 0.4.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/README.md +3 -2
- package/package.json +1 -1
- package/src/blob.mjs +8 -6
package/README.md
CHANGED
|
@@ -177,8 +177,9 @@ Monorepos can track nested paths by listing them explicitly:
|
|
|
177
177
|
|
|
178
178
|
## Opaque files (service-account keys, certs)
|
|
179
179
|
|
|
180
|
-
A tracked name whose basename is not `.env
|
|
181
|
-
one encrypted file, rather than parsed into keys
|
|
180
|
+
A tracked name whose basename is not `.env`, `.env.*`, or `*.env` is stored
|
|
181
|
+
**whole**, as one encrypted file, rather than parsed into keys — dotenv-shaped
|
|
182
|
+
names, including the `.config/auth.env` convention, are parsed instead:
|
|
182
183
|
|
|
183
184
|
```json
|
|
184
185
|
{ "project": "demo-app", "files": [".env", ".config/service-account.json"] }
|
package/package.json
CHANGED
package/src/blob.mjs
CHANGED
|
@@ -2,15 +2,17 @@ import { createHash } from 'node:crypto'
|
|
|
2
2
|
import { basename } from 'node:path'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* How a tracked name is classified when the cloud has no say yet: `.env
|
|
6
|
-
* `.env
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* How a tracked name is classified when the cloud has no say yet: `.env`,
|
|
6
|
+
* `.env.*`, and `*.env` basenames are dotenv files parsed into keys — the
|
|
7
|
+
* trailing form covers the `.config/auth.env` convention, which is KEY=value
|
|
8
|
+
* content under a descriptive name. Everything else — a service-account JSON,
|
|
9
|
+
* a cert — is an opaque file stored whole. For names the cloud already knows,
|
|
10
|
+
* its recorded kind wins; this function only decides the kind of a file's
|
|
11
|
+
* first push.
|
|
10
12
|
*/
|
|
11
13
|
export function isEnvName(name) {
|
|
12
14
|
const base = basename(name)
|
|
13
|
-
return base === '.env' || base.startsWith('.env.')
|
|
15
|
+
return base === '.env' || base.startsWith('.env.') || base.endsWith('.env')
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
/**
|