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

Function resolveTargetsFromEnv

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

Source from the content-addressed store, hash-verified

684// "executor-windows-x64") to Targets. Shared by `--target` and the
685// EXECUTOR_PREVIEW_TARGETS env used by the preview-wrapper CI job.
686const resolveTargetsFromEnv = (env: string | undefined): Target[] => {
687 if (!env) throw new Error("No build targets given (comma-separated package names)");
688 const names = env
689 .split(",")
690 .map((s) => s.trim())
691 .filter(Boolean);
692 const resolved = names.map((name) => {
693 const match = ALL_TARGETS.find((t) => targetPackageName(t) === name);
694 if (!match) {
695 const valid = ALL_TARGETS.map(targetPackageName).join(", ");
696 throw new Error(`Unknown build target: ${name}. Expected one of: ${valid}`);
697 }
698 return match;
699 });
700 if (resolved.length === 0) throw new Error("Build target list resolved to empty");
701 return resolved;
702};
703
704const buildPreviewWrapperPackage = async (targets: Target[]) => {
705 const meta = await readMetadata();

Callers 1

build.tsFile · 0.85

Calls 1

targetPackageNameFunction · 0.85

Tested by

no test coverage detected