| 66 | * installed `hyperframes` CLI. |
| 67 | */ |
| 68 | export function locateSamTemplate(repoRoot: string): string { |
| 69 | const candidate = join(repoRoot, "examples", "aws-lambda", "template.yaml"); |
| 70 | if (!existsSync(candidate)) { |
| 71 | throw new Error( |
| 72 | `[lambda] SAM template not found at ${candidate}. ` + |
| 73 | `If you're running from an installed package, point --sam-template at your local copy of examples/aws-lambda/template.yaml.`, |
| 74 | ); |
| 75 | } |
| 76 | return candidate; |
| 77 | } |
| 78 | |
| 79 | /** Run `sam deploy` non-interactively. Returns when SAM exits 0; throws on non-zero. */ |
| 80 | export function samDeploy(opts: DeployOptions): void { |