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

Function resolveTargetsFromEnv

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

Source from the content-addressed store, hash-verified

635// "executor-windows-x64") to Targets. Shared by `--target` and the
636// EXECUTOR_PREVIEW_TARGETS env used by the preview-wrapper CI job.
637const resolveTargetsFromEnv = (env: string | undefined): Target[] => {
638 if (!env) throw new Error("No build targets given (comma-separated package names)");
639 const names = env
640 .split(",")
641 .map((s) => s.trim())
642 .filter(Boolean);
643 const resolved = names.map((name) => {
644 const match = ALL_TARGETS.find((t) => targetPackageName(t) === name);
645 if (!match) {
646 const valid = ALL_TARGETS.map(targetPackageName).join(", ");
647 throw new Error(`Unknown build target: ${name}. Expected one of: ${valid}`);
648 }
649 return match;
650 });
651 if (resolved.length === 0) throw new Error("Build target list resolved to empty");
652 return resolved;
653};
654
655const buildPreviewWrapperPackage = async (targets: Target[]) => {
656 const meta = await readMetadata();

Callers 1

build.tsFile · 0.85

Calls 1

targetPackageNameFunction · 0.85

Tested by

no test coverage detected