@@ -87,7 +87,12 @@ async function prep_script(srcroot: Path, { pkg }: Installation, tmpdir: Path) {
8787 import test_runner from '${srcroot.join("projects", pkg.project, "test.ts").fileURL()}';
8888 import { Path, SemVer } from 'brewkit';
8989 const prefix = new Path(Deno.args[0]);
90- const version = new SemVer(prefix.basename());
90+ const version = new SemVer(Deno.args[1]);
91+
92+ for (const envln of Deno.args.slice(2)) {
93+ const [key, value] = envln.split("=");
94+ Deno.env.set(key, value);
95+ }
9196
9297 if (Deno.env.get("GITHUB_ACTIONS")) {
9398 console.log("::group::env");
@@ -121,7 +126,9 @@ async function prep_script(srcroot: Path, { pkg }: Installation, tmpdir: Path) {
121126 }
122127}
123128
124- async function run(deno: string, srcroot: Path, { path: prefix, pkg }: Installation, tmpdir: Path, env: Record<string, string>) {
129+ async function run(deno: string, srcroot: Path, { path: prefix, pkg }: Installation, tmpdir: Path, runenv: Record<string, string>) {
130+ const env: Record<string, string> = {}
131+
125132 let [cmd, ...args]: string[] = (() => {
126133 if (Deno.build.os !== 'darwin') return [deno];
127134
@@ -173,6 +180,7 @@ async function run(deno: string, srcroot: Path, { path: prefix, pkg }: Installat
173180 tmpdir.join("run-test.ts").string,
174181 prefix.string,
175182 pkg.version.toString(),
183+ ...Object.entries(runenv).map((value, key) => `${key}=${value}`),
176184 );
177185
178186 const cwd = tmpdir.join("testbed").mkdir().string;
0 commit comments