Skip to content

Commit a18d19b

Browse files
committed
feat: update terminal component to accept an extraEnv prop to pass through to guidebook exec
1 parent cc85228 commit a18d19b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: plugins/plugin-codeflare/src/controller/terminal.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export type Props = Pick<BaseProps, "tab" | "REPL" | "onExit"> & {
6161
/** Run guidebook in non-interactive mode? */
6262
defaultNoninteractive?: boolean
6363

64+
/** Any extra env vars to add to the guidebook execution. These will be pre-joined with the default env. */
65+
extraEnv?: BaseProps["env"]
66+
6467
/** Callback when user selects a profile */
6568
onSelectProfile?(profile: string, profiles?: import("madwizard").Profiles.Profile[]): void
6669

@@ -128,7 +131,7 @@ export class TaskTerminal extends React.PureComponent<Props, State> {
128131
this.setState((curState) => ({
129132
cmdline,
130133
initCount: curState.initCount + 1,
131-
env: Object.assign({}, env, { MWCLEAR_INITIAL: "true" }),
134+
env: Object.assign({}, env, { MWCLEAR_INITIAL: "true" }, this.props.extraEnv),
132135
}))
133136
} catch (error) {
134137
console.error("Error initializing command line", error)

0 commit comments

Comments
 (0)