docs: Add diferent ways of sourcing the export file

This commit is contained in:
Sergio Gasquez 2025-04-30 16:09:32 +02:00
parent 1b09495209
commit dcfbc0528b

View File

@ -77,13 +77,26 @@ See [Usage](#usage) section for more details.
```sh ```sh
espup install espup install
# Unix
. $HOME/export-esp.sh
# Windows does not require sourcing any file
``` ```
### Environment Variables Setup
After installing the toolchain, on **Unix systems**, you need to source a file that will export the environment variables. This file is generated by `espup` and is located in your home directory by default. There are different ways to source the file:
- Source this file in every terminal:
1. Source the export file: `. $HOME/export-esp.sh`
This approach **requires running the command in every new shell**.
- Create an alias for executing the `export-esp.sh`:
1. Copy and paste the following command to your shells profile (`.profile`, `.bashrc`, `.zprofile`, etc.): `alias get_esprs='. $HOME/export-esp.sh'`
2. Refresh the configuration by restarting the terminal session or by running `source [path to profile]`, for example, `source ~/.bashrc`.
This approach **requires running the alias in every new shell**.
- Add the environment variables to your shell profile directly:
1. Add the content of `$HOME/export-esp.sh` to your shells profile: `cat $HOME/export-esp.sh >> [path to profile]`, for example, `cat $HOME/export-esp.sh >> ~/.bashrc`.
2. Refresh the configuration by restarting the terminal session or by running `source [path to profile]`, for example, `source ~/.bashrc`.
> [!IMPORTANT] > [!IMPORTANT]
> The generated export file, by default `export-esp`, needs to be sourced in every terminal in Unix systems before building an application. On Windows, environment variables are automatically injected into your system and don't need to be sourced. > On Windows, environment variables are automatically injected into your system and don't need to be sourced.
## Usage ## Usage
@ -258,7 +271,7 @@ Options:
Print help (see a summary with '-h') Print help (see a summary with '-h')
``` ```
## Enable tab completion for Bash, Fish, Zsh, or PowerShell ## Enable Tab Completion for Bash, Fish, Zsh, or PowerShell
`espup` supports generating completion scripts for Bash, Fish, Zsh, and `espup` supports generating completion scripts for Bash, Fish, Zsh, and
PowerShell. See `espup help completions` for full details, but the gist is as PowerShell. See `espup help completions` for full details, but the gist is as