canary-test-cli 5.12.0 → 5.14.0
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/bin/canary +0 -0
- package/dist/doctor-manifest.js +6 -2
- package/dist/doctor.js +1 -0
- package/package.json +1 -1
package/bin/canary
CHANGED
|
Binary file
|
package/dist/doctor-manifest.js
CHANGED
|
@@ -256,11 +256,12 @@ function defaultProbeUrl(url, timeoutMs) {
|
|
|
256
256
|
});
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
const defaultRunCommand = (command, cwd, timeoutMs) => {
|
|
259
|
+
const defaultRunCommand = (command, cwd, timeoutMs, extraEnv) => {
|
|
260
260
|
const r = (0, node_child_process_1.spawnSync)(command[0], command.slice(1), {
|
|
261
261
|
cwd,
|
|
262
262
|
timeout: timeoutMs,
|
|
263
263
|
encoding: 'utf8',
|
|
264
|
+
env: extraEnv ? { ...process.env, ...extraEnv } : process.env,
|
|
264
265
|
});
|
|
265
266
|
if (r.error) {
|
|
266
267
|
const code = r.error.code;
|
|
@@ -312,7 +313,10 @@ function runCommandSucceeds(check, ctx, timeoutMs) {
|
|
|
312
313
|
const command = check.command ?? [];
|
|
313
314
|
const cmd = `\`${command.join(' ')}\``;
|
|
314
315
|
const runner = ctx.runCommand ?? defaultRunCommand;
|
|
315
|
-
const
|
|
316
|
+
const extraEnv = ctx.invocationDir
|
|
317
|
+
? { CANARY_INVOCATION_DIR: ctx.invocationDir }
|
|
318
|
+
: undefined;
|
|
319
|
+
const r = runner(command, ctx.cloneDir, timeoutMs, extraEnv);
|
|
316
320
|
if (r.ok) {
|
|
317
321
|
return pass(check, `${check.id}: ${cmd} succeeded`);
|
|
318
322
|
}
|
package/dist/doctor.js
CHANGED
|
@@ -126,6 +126,7 @@ async function overlayResults(entry, deps, audience) {
|
|
|
126
126
|
const checks = (0, doctor_manifest_js_1.filterByAudience)(load.checks, audience);
|
|
127
127
|
const ctx = {
|
|
128
128
|
cloneDir: entry.path,
|
|
129
|
+
invocationDir: deps.cwd ?? process.cwd(),
|
|
129
130
|
consentGranted: granted,
|
|
130
131
|
timeoutMs: deps.timeoutMs,
|
|
131
132
|
probeUrl: deps.probeUrl,
|