-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
45 lines (36 loc) · 1.3 KB
/
Makefile
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
45
# Check if Docker is installed
DOCKER := $(shell command -v docker 2> /dev/null)
# Check if Podman is installed
PODMAN := $(shell command -v podman 2> /dev/null)
# If neither Docker nor Podman is installed, exit with an error
ifeq (,$(or $(DOCKER),$(PODMAN)))
$(error "Neither Docker nor Podman is installed.")
endif
# If Podman is installed, use it instead of Docker
ifdef PODMAN
CONTAINER_ENGINE := podman
else
CONTAINER_ENGINE := docker
endif
.PHONY: help build release patch
all: build
help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build the nerd-fonts-patcher image"
@echo " 2. make release - build the nerd-fonts-patcher image with the version tag"
@echo " 3. make patch - patch monospace fonts inside '$(shell pwd)/in' directory with the complete set of glyphs"
build:
$(CONTAINER_ENGINE) build --tag=ghcr.io/cdalvaro/docker-nerd-fonts-patcher:latest .
release: build
$(CONTAINER_ENGINE) tag ghcr.io/cdalvaro/docker-nerd-fonts-patcher:latest \
ghcr.io/cdalvaro/docker-nerd-fonts-patcher:$(shell cat VERSION) .
patch:
$(CONTAINER_ENGINE) run -it --rm \
--volume $(shell pwd)/in:/input \
--volume $(shell pwd)/out:/output \
--user $(shell id -u):$(shell id -g) \
-- \
ghcr.io/cdalvaro/docker-nerd-fonts-patcher:latest \
--quiet --no-progressbars --complete