#!/usr/bin/env bash # Builds the firmware with the credentials from .env (see .env.example). # # esp-idf-sys downloads the pinned ESP-IDF automatically. Set IDF_PATH in the # environment to reuse an existing installation (see README.md). set -euo pipefail cd "$(dirname "$0")/.." # Resolve the SDK defaults/components from this repository even when the build # cache is elsewhere, and copy the partition table into the CMake project. export CARGO_WORKSPACE_DIR="$PWD" export ESP_IDF_GLOB_BASE="$PWD" export ESP_IDF_GLOB_PARTITIONS="partitions.csv" if [ -f .env ]; then set -a # shellcheck disable=SC1091 . ./.env set +a fi : "${WIFI_SSID:?set WIFI_SSID in .env (or export it) before building}" export WIFI_PASS="${WIFI_PASS:-}" cargo build --release --locked "$@"