MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda-cdk / exec

Function exec

src/util.ts:9–24  ·  view source on GitHub ↗
(cmd: string, args: string[], options?: SpawnSyncOptions)

Source from the content-addressed store, hash-verified

7 * Spawn sync with error handling
8 */
9export function exec(cmd: string, args: string[], options?: SpawnSyncOptions) {
10 const proc = spawnSync(cmd, args, options);
11
12 if (proc.error) {
13 throw proc.error;
14 }
15
16 if (proc.status !== 0) {
17 if (proc.stdout || proc.stderr) {
18 throw new Error(`[Status ${proc.status}] stdout: ${proc.stdout?.toString().trim()}\n\n\nstderr: ${proc.stderr?.toString().trim()}`);
19 }
20 throw new Error(`${cmd} exited with status ${proc.status}`);
21 }
22
23 return proc;
24}
25
26export function bundlingOptionsFromRustFunctionProps(props?: RustFunctionProps): BundlingOptions {
27 if (props?.bundling?.architecture && props?.architecture && props?.bundling?.architecture !== props?.architecture) {

Callers 2

tryBundleMethod · 0.90
getManifestPathFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected