Skip to content

Commit

Permalink
Add Process.unsafe and Process.networking fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy committed May 22, 2024
1 parent 2777236 commit 377b6ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions projects/std/core/recipes/process.bri
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import * as runtime from "../runtime.bri";
import { type Directory, directory } from "./directory.bri";
import { type AsyncRecipe, type Recipe, createRecipe } from "./recipe.bri";

export interface ProcessOptions {
export type ProcessOptions = {
command: ProcessTemplateLike;
args?: ProcessTemplateLike[];
env?: Record<string, ProcessTemplateLike>;
workDir?: AsyncRecipe<Directory>;
outputScaffold?: AsyncRecipe | null;
}
} & ({ unsafe?: false } | { unsafe: true; networking?: boolean });

export type Process = Recipe & ProcessUtils;

Expand Down Expand Up @@ -58,6 +58,8 @@ export function process(options: ProcessOptions): Process {
options.outputScaffold != null
? await (await options.outputScaffold).briocheSerialize()
: null,
unsafe: options.unsafe,
networking: options.unsafe === true ? options.networking : undefined,
meta,
};
},
Expand Down
2 changes: 2 additions & 0 deletions projects/std/core/runtime.bri
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export type ProcessRecipe = WithMeta & {
workDir: Recipe;
outputScaffold?: Recipe | null;
platform: Platform;
unsafe?: boolean;
networking?: boolean;
};

export type CreateFileRecipe = WithMeta & {
Expand Down

0 comments on commit 377b6ba

Please sign in to comment.