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

Function resolveTargetsFromEnv

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

Source from the content-addressed store, hash-verified

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

Callers 1

build.tsFile · 0.85

Calls 1

targetPackageNameFunction · 0.85

Tested by

no test coverage detected