Skip to content
Open
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
5 changes: 2 additions & 3 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ Print the current `zx` version.
Print help notes.

## Environment variables
All the previously mentioned options can be set via the corresponding `ZX_`-prefixed environment variables.
Most options can be set via the corresponding `ZX_`-prefixed environment variables. For security reasons, `shell`, `prefix`, and `postfix` cannot be set via environment variables.

```bash
ZX_VERBOSE=true ZX_SHELL='/bin/bash' zx script.mjs
ZX_VERBOSE=true zx script.mjs
```

```yaml
Expand All @@ -175,7 +175,6 @@ steps:
run: zx script.mjs
env:
ZX_VERBOSE: true
ZX_SHELL: '/bin/bash'
```

## `__filename & __dirname`
Expand Down
6 changes: 1 addition & 5 deletions docs/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ There're many shell implementations. zx brings a few setup helpers:
* [`usePowerShell`](./api#usepowershell) — PowerShell
* [`usePwsh`](./api#usepwsh) — pwsh (PowerShell v7+)

You can also set the shell directly via [JS API](./setup#bash), [CLI flags](./cli#shell) or [envars](./cli#environment-variables):
You can also set the shell directly via [JS API](./setup#bash) or [CLI flags](./cli#shell):

```js
$.shell = '/bin/zsh'
Expand All @@ -45,9 +45,5 @@ $.shell = '/bin/zsh'
zx --shell /bin/zsh script.js
```

```bash
ZX_SHELL=/bin/zsh zx script.js
```

## zx = bash + js
No compromise, take the best of both.
3 changes: 0 additions & 3 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ const ENV_OPTS: Set<string> = new Set([
'timeout',
'timeoutSignal',
'killSignal',
'prefix',
'postfix',
'shell',
])

// prettier-ignore
Expand Down