Skip to content

Commit

Permalink
Merge pull request #5 from obgr/enhance/create-image-path
Browse files Browse the repository at this point in the history
Enhance/create image path
  • Loading branch information
eliasbakken authored Dec 3, 2023
2 parents cbb1c91 + 6557b1b commit f88b7c1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ if ! test -d "$BUILD_DIR" ; then
git clone https://github.com/armbian/build $BUILD_DIR
fi

IMG_DIR="../images"
if [[ ! -e $IMG_DIR ]]; then
echo "Creating Output directory $IMG_DIR"
mkdir $IMG_DIR
elif [[ ! -d $IMG_DIR ]]; then
echo "$IMG_DIR exists but not a directory"
exit 20 # Not a directory
fi

ROOT_DIR=$(pwd)
TAG=$(git describe --always --tags)
NAME="rebuild-${VERSION}-${TAG}"
Expand All @@ -62,5 +71,5 @@ cd "$BUILD_DIR"
DOCKER_EXTRA_ARGS="--cpus=${cores}" ./compile.sh rebuild
IMG=$(ls -1 output/images/ | grep "img.xz$")

mv "$BUILD_DIR"/output/images/"$IMG" "../images/${NAME}.img.xz"
mv "$BUILD_DIR"/output/images/"$IMG" "${IMG_DIR}/${NAME}.img.xz"
echo "🍰 Finished building ${NAME}"

0 comments on commit f88b7c1

Please sign in to comment.