From 404c4dedc1aa1ca61e060db2bf1ac183183e5e3d Mon Sep 17 00:00:00 2001 From: Kyle Lacy Date: Sun, 26 May 2024 00:23:03 -0700 Subject: [PATCH] Add `dependencies` option to `std.process` (#9) * Update `runtime.ProcessRecipe` type with new `dependencies` field * Add `dependencies` option to `std.process` --- projects/std/core/recipes/process.bri | 6 ++++++ projects/std/core/runtime.bri | 1 + 2 files changed, 7 insertions(+) diff --git a/projects/std/core/recipes/process.bri b/projects/std/core/recipes/process.bri index fb63cba..1564354 100644 --- a/projects/std/core/recipes/process.bri +++ b/projects/std/core/recipes/process.bri @@ -7,6 +7,7 @@ export type ProcessOptions = { command: ProcessTemplateLike; args?: ProcessTemplateLike[]; env?: Record; + dependencies?: AsyncRecipe[]; workDir?: AsyncRecipe; outputScaffold?: AsyncRecipe | null; } & ({ unsafe?: false } | { unsafe: true; networking?: boolean }); @@ -50,6 +51,11 @@ export function process(options: ProcessOptions): Process { ]), ), ), + dependencies: await Promise.all( + (options.dependencies ?? []).map( + async (dep) => await (await dep).briocheSerialize(), + ), + ), platform: "x86_64-linux", workDir: await ( await (options.workDir ?? directory()) diff --git a/projects/std/core/runtime.bri b/projects/std/core/runtime.bri index ebac314..ee5390e 100644 --- a/projects/std/core/runtime.bri +++ b/projects/std/core/runtime.bri @@ -118,6 +118,7 @@ export type ProcessRecipe = WithMeta & { command: ProcessTemplate; args: ProcessTemplate[]; env: Record; + dependencies?: Recipe[]; workDir: Recipe; outputScaffold?: Recipe | null; platform: Platform;