Refactor BUILDROOT_ABS initialization to provide a default path (#991)

This commit is contained in:
Jerry Ma 2025-12-08 12:33:37 +08:00 committed by GitHub
parent eab105965d
commit 127c935106
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,7 @@
#!/usr/bin/env bash
if [ "$BUILD_ROOT_PATH" = "" ]; then
echo "The script must be run in the SPC build environment."
exit 1
fi
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
BUILDROOT_ABS=$BUILD_ROOT_PATH
BUILDROOT_ABS="${BUILD_ROOT_PATH:-$(realpath "$SCRIPT_DIR/../../../buildroot/include" 2>/dev/null || true)}"
PARSED_ARGS=()
while [[ $# -gt 0 ]]; do