mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
feat: refine portal flow and examples
This commit is contained in:
@@ -42,6 +42,19 @@ for required in README.md CHANGELOG.md docs/README.md docs/GETTING_STARTED.md do
|
||||
fi
|
||||
done
|
||||
|
||||
while IFS= read -r example; do
|
||||
for required in README.md platformio.ini; do
|
||||
if [[ ! -f "$example/$required" ]]; then
|
||||
printf 'Incomplete example: %s is missing %s\n' "${example#$root/}" "$required" >&2
|
||||
failed=1
|
||||
fi
|
||||
done
|
||||
if ! find "$example" -maxdepth 2 -type f \( -name '*.ino' -o -name '*.cpp' \) -print -quit | grep -q .; then
|
||||
printf 'Incomplete example: %s has no sketch source\n' "${example#$root/}" >&2
|
||||
failed=1
|
||||
fi
|
||||
done < <(find "$root/examples" -mindepth 1 -maxdepth 1 -type d -print | sort)
|
||||
|
||||
if [[ "$failed" -ne 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
+15
-2
@@ -2,15 +2,28 @@
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 compile --platform esp8266|esp32" >&2
|
||||
echo "Usage: $0 compile|examples --platform esp8266|esp32" >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
[[ "${1:-}" == "compile" && "${2:-}" == "--platform" && $# -eq 3 ]] || usage
|
||||
[[ $# -eq 3 && ( "${1:-}" == "compile" || "${1:-}" == "examples" ) && "${2:-}" == "--platform" ]] || usage
|
||||
platform="${3:-}"
|
||||
[[ "$platform" == "esp8266" || "$platform" == "esp32" ]] || usage
|
||||
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
if [[ "$1" == "examples" ]]; then
|
||||
mapfile -t examples < <(find "$root/examples" -mindepth 2 -maxdepth 2 -type f -name platformio.ini -printf '%h\n' | sort)
|
||||
if (( ${#examples[@]} == 0 )); then
|
||||
echo "No example projects found" >&2
|
||||
exit 1
|
||||
fi
|
||||
for example in "${examples[@]}"; do
|
||||
pio run -d "$example" -e "$platform" </dev/null
|
||||
done
|
||||
echo "WiFiManager examples compile check passed for $platform"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cached_library="$root/test/compile-project/.pio/libdeps/${platform}/WiFiManager"
|
||||
# The fixture intentionally declares only this local package. Remove a prior
|
||||
# link so each check resolves the current manifest as a fresh consumer would.
|
||||
|
||||
Reference in New Issue
Block a user