in packages/aws-c2a/lib/cloud-assembly.ts [171:191]
private selectDefaultStacks(stacks: cxapi.CloudFormationStackArtifact[],
topLevelStacks: cxapi.CloudFormationStackArtifact[],
defaultSelection: DefaultSelection) {
switch (defaultSelection) {
case DefaultSelection.MainAssembly:
return new StackCollection(this, topLevelStacks);
case DefaultSelection.AllStacks:
return new StackCollection(this, stacks);
case DefaultSelection.None:
return new StackCollection(this, []);
case DefaultSelection.OnlySingle:
if (topLevelStacks.length === 1) {
return new StackCollection(this, topLevelStacks);
} else {
throw new Error('Since this app includes more than a single stack, specify which stacks to use (wildcards are supported) or specify `--all`\n' +
`Stacks: ${stacks.map(x => x.hierarchicalId).join(' · ')}`);
}
default:
throw new Error(`invalid default behavior: ${defaultSelection}`);
}
}