diff --git a/debian-live-config/build.sh b/debian-live-config/build.sh index 7119227e..9aadd9fa 100755 --- a/debian-live-config/build.sh +++ b/debian-live-config/build.sh @@ -4,8 +4,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) BUILD_DIR=/var/tmp/wrolpi-build-debian -VERSION=$(cat "${SCRIPT_DIR}/../wrolpi/version.txt") - Help() { echo "Build WROLPi Debian Live ISO image." echo @@ -25,6 +23,14 @@ while getopts ":hb:" option; do esac done +# Get version from the target git branch (not local checkout) so output filename matches actual content. +VERSION=$(curl -sL "https://raw.githubusercontent.com/lrnselfreliance/wrolpi/${BRANCH}/wrolpi/version.txt") +if [ -z "${VERSION}" ]; then + echo "ERROR: Could not fetch version from branch '${BRANCH}'" + exit 1 +fi +echo "Building WROLPi version: ${VERSION} from branch: ${BRANCH}" + # Re-execute this script if it wasn't called with sudo. if [ $EUID != 0 ]; then sudo "$0" "$@" diff --git a/pi-gen/build.sh b/pi-gen/build.sh index 3af762d4..3abd8f9f 100755 --- a/pi-gen/build.sh +++ b/pi-gen/build.sh @@ -4,8 +4,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) BUILD_DIR=/var/tmp/wrolpi-build-pi-gen -VERSION=$(cat "${SCRIPT_DIR}/../wrolpi/version.txt") - Help() { echo "Build WROLPi Raspberry Pi OS image." echo @@ -25,6 +23,14 @@ while getopts ":hb:" option; do esac done +# Get version from the target git branch (not local checkout) so output filename matches actual content. +VERSION=$(curl -sL "https://raw.githubusercontent.com/lrnselfreliance/wrolpi/${BRANCH}/wrolpi/version.txt") +if [ -z "${VERSION}" ]; then + echo "ERROR: Could not fetch version from branch '${BRANCH}'" + exit 1 +fi +echo "Building WROLPi version: ${VERSION} from branch: ${BRANCH}" + # Re-execute this script if it wasn't called with sudo. if [ $EUID != 0 ]; then sudo "$0" "$@"