mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Fetching latest release version when building images so they are named correctly.
This commit is contained in:
parent
c076cb2f66
commit
ae72b9491d
2 changed files with 16 additions and 4 deletions
|
|
@ -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" "$@"
|
||||
|
|
|
|||
|
|
@ -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" "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue