-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·44 lines (36 loc) · 1.14 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·44 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
export DOCKER_BUILDKIT=1
BUILD_DIR=/build
FONT_NAME=${FONT_NAME:-afio}
BUILD_PLAN=${BUILD_PLAN:-private-build-plans.toml}
OUTPUT_DIR=$(pwd)/_output
IMAGE=${IMAGE:-ghcr.io/awnion/custom-iosevka-nerd-font}
IMAGE_REF=${IMAGE_REF:-}
rm -rf "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"
if [ -z "$IMAGE_REF" ]; then
VERSION=$(cat VERSION | tr -d '[:space:]')
IMAGE_REF="${IMAGE}:${VERSION}"
if docker pull "$IMAGE_REF" 2>/dev/null; then
echo "Using pre-built image: $IMAGE_REF"
else
echo "Image $IMAGE_REF not found, building locally..."
docker buildx build \
--load \
--iidfile "$OUTPUT_DIR"/iddfile \
.
IMAGE_REF=$(cat "$OUTPUT_DIR"/iddfile)
fi
else
echo "Using provided image: $IMAGE_REF"
fi
echo "Building font '$FONT_NAME' using plan '$BUILD_PLAN' ..."
docker run --rm -t \
-v "$OUTPUT_DIR":/output \
-v "$(pwd)/$BUILD_PLAN":${BUILD_DIR}/iosevka/private-build-plans.toml:ro \
"$IMAGE_REF" -c "\
cd ${BUILD_DIR}/iosevka && \
bun run build -- ttf::${FONT_NAME} && \
cd ${BUILD_DIR} && \
python3 nerd-patcher.py"