Path
Specify the same PATH entries cross shell.
Syntaxโ
path:
- value: |
{{ .Home }}/homebrew/bin
/usr/local/bin/
/opt/local/bin/
if: eq .OS "darwin"
- value: |
{{ .Home }}/go/bin/
{{ env "VOLTA_HOME" }}/bin
ifExists: true
force: true
Pathโ
| Name | Type | Description |
|---|---|---|
value | string | the path entires you want to add, separated by a newline. Supports templating |
if | string | golang template conditional statement, see if |
persist | boolean | if you want to persist the path entry into the registry for the current user (Windows only) |
force | boolean | if you want to always export the path even if it already exists in your current shell |
ifExists | boolean | if you want to add only entries that exist on disk (default: false) |
Windows and MSYS pathsโ
Set path.value entries using your OS-native path format.
On Windows, use Windows-style paths such as P:\tools\bin.
When aliae renders output for MSYS shells at runtime (for example Git Bash),
it converts those entries to MSYS style automatically.
Example:
path:
- value: |
P:\tools\bin
P:\scripts
Runtime output in Git Bash:
export PATH="/p/tools/bin:$PATH"
export PATH="/p/scripts:$PATH"
Expected output by shellโ
The examples below use:
path:
- value: /usr/local/bin
- bash
- zsh
- fish
- pwsh
- nu
- tcsh
- xonsh
- cmd
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/bin:$PATH"
fish_add_path /usr/local/bin
$env:PATH = "/usr/local/bin" + ':' + $env:PATH
$env.PATH = ($env.PATH | prepend "/usr/local/bin")
set path = ( /usr/local/bin $path );
$PATH.add('/usr/local/bin', True, False)
os.setenv("PATH", "/usr/local/bin;" .. os.getenv("PATH"))