build: add BUILD variable

This commit is contained in:
2026-09-13 23:01:28 +02:00
parent 2a0405da32
commit 2877ffaa15
+8 -6
View File
@@ -3,9 +3,11 @@ set -euo pipefail
readonly ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
readonly BUILD="$ROOT/build-twrp"
readonly MANIFEST_URL="https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git"
readonly MANIFEST_BRANCH="twrp-5.1"
readonly RECOVERY_BUDGET=10485248
rlte_print() { printf '\033[34m[%s] %s\033[0m\n' "$0" "$*" ; }
rlte_error() { printf '\033[31m[%s] error: %s\033[0m\n' "$0" "$*" >&2 ; exit 1; }
@@ -21,14 +23,14 @@ flags:
commands:
build build recovery.img (must be explicit)
clean remove twrp-build/out and recovery.img
prune remove all of twrp-build and recovery.img
clean remove "$BUILD"/out and recovery.img
prune remove all of "$BUILD" and recovery.img
EOF
}
do_build() {
mkdir -p twrp-build
cd twrp-build
mkdir -p "$BUILD"
cd "$BUILD"
if [ ! -d .repo ]; then
rlte_print "Setting up repo"
@@ -86,7 +88,7 @@ shift $((OPTIND - 1))
case "${1:-}" in
build) do_build ;;
clean) rm -rf twrp-build/out recovery.img ;;
prune) rm -rf twrp-build recovery.img ;;
clean) rm -rf "$BUILD"/out recovery.img ;;
prune) rm -rf "$BUILD" recovery.img ;;
*) usage; exit 1 ;;
esac