Skip to content

Commit

Permalink
Update std.setEnv() to validate Brioche version
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy committed Sep 28, 2024
1 parent ef55cdf commit d91791c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/std/extra/set_env.bri
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,20 @@ export function setEnv(
);
}
} else if ("fallback" in value && "path" in value.fallback) {
// TODO: Throw error if not Brioche >= 0.1.2
std.assert(
std.semverMatches(std.BRIOCHE_VERSION, ">=0.1.2"),
"fallback env vars require Brioche v0.1.2 or later",
);

result = result.insert(
`brioche-env.d/env/${key}`,
std.symlink({ target: `../../${value.fallback.path}` }),
);
} else if ("fallback" in value && "value" in value.fallback) {
// TODO: Throw error if not Brioche >= 0.1.2
std.assert(
std.semverMatches(std.BRIOCHE_VERSION, ">=0.1.2"),
"fallback env vars require Brioche v0.1.2 or later",
);

result = result.insert(
`brioche-env.d/env/${key}`,
Expand Down

0 comments on commit d91791c

Please sign in to comment.