cf-envsync 0.3.6 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +6 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13196,9 +13196,14 @@ async function loadEnvFile(filePath, env2, projectRoot, encryption) {
13196
13196
  }
13197
13197
  if (encryption === "password") {
13198
13198
  const envMap = parsePlainEnv(content);
13199
+ const hasEncryptedValues = Object.values(envMap).some((v2) => v2.startsWith("envsync:v1:"));
13199
13200
  const password = findPassword(env2, projectRoot);
13200
- if (!password)
13201
+ if (!password) {
13202
+ if (hasEncryptedValues) {
13203
+ throw new Error(`${filePath} contains encrypted values but no password found. ` + `Set ENVSYNC_PASSWORD${env2 ? `_${env2.toUpperCase()}` : ""} or create .env.password`);
13204
+ }
13201
13205
  return envMap;
13206
+ }
13202
13207
  return decryptEnvMap(envMap, password);
13203
13208
  }
13204
13209
  const privateKey = findPrivateKey(env2, projectRoot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-envsync",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Sync .env files to Cloudflare Workers secrets, .dev.vars, and more",
5
5
  "type": "module",
6
6
  "exports": {