Throws with a clear hint when the SAM CLI is not on PATH.
()
| 24 | |
| 25 | /** Throws with a clear hint when the SAM CLI is not on PATH. */ |
| 26 | function assertSamAvailable(): void { |
| 27 | try { |
| 28 | execFileSync("sam", ["--version"], { stdio: "ignore" }); |
| 29 | } catch { |
| 30 | throw new Error( |
| 31 | "`sam` CLI not found on PATH. Install AWS SAM CLI from https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html and retry.", |
| 32 | ); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | /** Throws with a clear hint when the `aws` CLI is not on PATH. */ |
| 37 | function assertAwsCliAvailable(): void { |