docs: 📝 Add quickstart section

This commit is contained in:
Sergio Gasquez 2022-10-11 13:01:44 +02:00
parent 235e4f7735
commit f61933cf3e
2 changed files with 44 additions and 4 deletions

View File

@ -37,6 +37,42 @@ cargo install espup --git https://github.com/esp-rs/espup
```
It's also possible to directly download the pre-compiled [release binaries](https://github.com/esp-rs/espup/releases) or using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall).
## Quickstart
See [Usage](#usage) section for more details.
### Install
- [`no_std`](https://esp-rs.github.io/book/overview/bare-metal.html)
```sh
espup install
# Unix
. ./export-esp.sh
# Windows
.\export-esp.ps1
```
- [`std`](https://esp-rs.github.io/book/overview/using-the-standard-library.html):
Installing `esp-idf` via `espup` is not mandatory, as [`esp-idf-sys`](https://github.com/esp-rs/esp-idf-sys) already takes care of it, but has some benefits.
```sh
espup install --espidf-version <ESPIDF_VERSION>
# Unix
. ./export-esp.sh
# Windows
.\export-esp.ps1
```
> **Warning**
>
> The generated export file, by default `export-esp`, needs to be sourced in every terminal
> before building an application.
### Uninstall
```sh
espup uninstall
```
### Update
```sh
espup update --toolchain-version <TOOLCHAIN_VERSION>
```
## Usage
```

View File

@ -19,7 +19,7 @@ use espup::{
},
},
};
use log::{debug, info};
use log::{debug, info, warn};
use std::{
collections::HashSet,
fs::{remove_dir_all, File},
@ -204,6 +204,10 @@ fn install(args: InstallOpts) -> Result<()> {
export_environment(&export_file, &exports)?;
info!("{} Installation suscesfully completed!", emoji::CHECK);
warn!(
"{} Please, source the export file, as state above, to properly setup the environment!",
emoji::WARN
);
Ok(())
}
@ -290,18 +294,18 @@ pub fn export_environment(export_file: &PathBuf, exports: &[String]) -> Result<(
file.write_all(b"\n")?;
}
#[cfg(windows)]
info!(
warn!(
"{} PLEASE set up the environment variables running: '.\\{}'",
emoji::INFO,
export_file.display()
);
#[cfg(unix)]
info!(
warn!(
"{} PLEASE set up the environment variables running: '. ./{}'",
emoji::INFO,
export_file.display()
);
info!(
warn!(
"{} This step must be done every time you open a new terminal.",
emoji::WARN
);