Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tui): Set TURBO_IS_TUI environment variable when using TUI. #8897

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/turborepo-lib/src/task_graph/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,12 @@ impl ExecContext {
cmd.envs(self.execution_env.iter());
// Always last to make sure it overwrites any user configured env var.
cmd.env("TURBO_HASH", &self.task_hash);

// Allow downstream tools to detect if the task is being ran with TUI
if self.experimental_ui {
cmd.env("TURBO_IS_TUI", "true");
}

// enable task access tracing

// set the trace file env var - frameworks that support this can use it to
Expand Down
7 changes: 4 additions & 3 deletions docs/repo-docs/reference/system-environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ System environment variables are always overridden by flag values provided direc

Turborepo will make the following environment variables available within your tasks while they are executing:

| Variable | Description |
| ------------ | --------------------------------------- |
| `TURBO_HASH` | The hash of the currently running task. |
| Variable | Description |
| -------------- | -------------------------------------------------------------------------------------------- |
| `TURBO_HASH` | The hash of the currently running task. |
| `TURBO_IS_TUI` | When using the [TUI](/repo/docs/reference/configuration#ui), this variable is set to `true`. |
Empty file added grep
Empty file.
Loading