MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveTargetsFromEnv

Function resolveTargetsFromEnv

apps/cli/src/build.ts:606–622  ·  view source on GitHub ↗
(env: string | undefined)

Source from the content-addressed store, hash-verified

604// "executor-windows-x64") to Targets. Shared by `--target` and the
605// EXECUTOR_PREVIEW_TARGETS env used by the preview-wrapper CI job.
606const resolveTargetsFromEnv = (env: string | undefined): Target[] => {
607 if (!env) throw new Error("No build targets given (comma-separated package names)");
608 const names = env
609 .split(",")
610 .map((s) => s.trim())
611 .filter(Boolean);
612 const resolved = names.map((name) => {
613 const match = ALL_TARGETS.find((t) => targetPackageName(t) === name);
614 if (!match) {
615 const valid = ALL_TARGETS.map(targetPackageName).join(", ");
616 throw new Error(`Unknown build target: ${name}. Expected one of: ${valid}`);
617 }
618 return match;
619 });
620 if (resolved.length === 0) throw new Error("Build target list resolved to empty");
621 return resolved;
622};
623
624const buildPreviewWrapperPackage = async (targets: Target[]) => {
625 const meta = await readMetadata();

Callers 1

build.tsFile · 0.85

Calls 1

targetPackageNameFunction · 0.85

Tested by

no test coverage detected