forked from continuous-foundation/pubmatter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (21 loc) · 929 Bytes
/
Makefile
File metadata and controls
24 lines (21 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.PHONY: all copy-files clean
# Extract the `version` value from typst.toml
VERSION := $(shell sed -n 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' typst.toml)
# Define a variable for the folder where files will be copied
PACKAGE_FOLDER := ../typst-packages/packages/preview/pubmatter/$(VERSION)
copy-files:
@echo "Checking README.md for version $(VERSION)..."
@if ! grep -q "@preview/pubmatter:$(VERSION)" README.md; then \
echo "Error: README.md does not contain the latest version @preview/pubmatter:$(VERSION)"; \
exit 1; \
fi
@echo "✓ README.md contains correct version"
@echo "Creating folder: $(PACKAGE_FOLDER)"
@mkdir -p $(PACKAGE_FOLDER)
@echo "Copying files into $(PACKAGE_FOLDER) ..."
cp LICENSE $(PACKAGE_FOLDER)
cp README.md $(PACKAGE_FOLDER)
cp pubmatter.typ $(PACKAGE_FOLDER)
cp typst.toml $(PACKAGE_FOLDER)
cp validate-frontmatter.typ $(PACKAGE_FOLDER)
@echo "Done copying files."