@penvhq/cli 0.3.1 → 0.3.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/dist/index.js CHANGED
@@ -688,6 +688,7 @@ import {
688
688
  PenvError as PenvError5,
689
689
  ReservedTokenError as ReservedTokenError2,
690
690
  resolveAll,
691
+ SCHEMA_HARVEST_ENV,
691
692
  schemaFileOf,
692
693
  validateConfig
693
694
  } from "@penvhq/core";
@@ -772,7 +773,9 @@ function loadSchema(project, environment) {
772
773
  async function loadSchemaExclusively(file, schemaPath, environment) {
773
774
  const jiti = jitiFor(file);
774
775
  const previous = process.env.PENV_ENV;
776
+ const previousHarvest = process.env[SCHEMA_HARVEST_ENV];
775
777
  process.env.PENV_ENV = environment;
778
+ process.env[SCHEMA_HARVEST_ENV] = "1";
776
779
  let loaded;
777
780
  try {
778
781
  loaded = await jiti.import(file);
@@ -798,6 +801,11 @@ async function loadSchemaExclusively(file, schemaPath, environment) {
798
801
  } else {
799
802
  process.env.PENV_ENV = previous;
800
803
  }
804
+ if (previousHarvest === void 0) {
805
+ delete process.env[SCHEMA_HARVEST_ENV];
806
+ } else {
807
+ process.env[SCHEMA_HARVEST_ENV] = previousHarvest;
808
+ }
801
809
  }
802
810
  const exported = typeof loaded === "object" && loaded !== null ? loaded[SCHEMA_EXPORT] : void 0;
803
811
  if (!isZodType(exported)) {