Skip to content

Commit 6c4fdfd

Browse files
committed
Refactor zip generation script and update Makefile.
1 parent a0a800f commit 6c4fdfd

File tree

2 files changed

+41
-26
lines changed

2 files changed

+41
-26
lines changed

Makefile

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,18 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
22
# SPDX-License-Identifier: MIT
33

4-
.SHELLFLAGS=-e -x -o pipefail -c
4+
.SHELLFLAGS=-e -o pipefail -c
55
.ONESHELL:
6+
SHELL=bash
7+
.PHONY: zip all test clean
68

7-
TLROOT=$$(kpsewhich -var-value TEXMFDIST)
8-
PACKAGES=ffcode to-be-determined href-ul eolang
9-
REPO=objectionary/reducing-programs-to-objects
9+
all: paper.pdf zip
10+
11+
paper.pdf: paper.tex
12+
latexmk -pdf -latexoption=-interaction=errorstopmode -latexoption=-halt-on-error paper
1013

1114
zip: *.tex
12-
rm -rf package
13-
mkdir package
14-
cd package
15-
cp ../paper.tex .
16-
mkdir -p bibliography
17-
cp ../bibliography/main.bib ./bibliography/main.bib
18-
cp ../goto-pic.pdf .
19-
for p in $(PACKAGES); do
20-
cp "$(TLROOT)/tex/latex/$${p}/$${p}.sty" .
21-
done
22-
version=$$(curl --silent -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/$(REPO)/releases/latest" | jq -r '.tag_name')
23-
echo "Version is: $${version}"
24-
gsed -i "s|0\.0\.0|$${version}|" paper.tex
25-
gsed -i "s|REPOSITORY|$(REPO)|" paper.tex
26-
pdflatex -shell-escape -halt-on-error paper.tex
27-
biber paper
28-
pdflatex -halt-on-error paper.tex
29-
pdflatex -halt-on-error paper.tex
30-
rm -rf ./*.aux ./*.bcf ./*.blg ./*.fdb_latexmk ./*.fls ./*.log ./*.run.xml ./*.out ./*.exc
31-
zip -x paper.pdf -r "paper-$${version}.zip" *
32-
mv "paper-$${version}.zip" ..
33-
cd ..
15+
./zip-it.sh
3416

3517
clean:
3618
git clean -dfX

zip-it.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
3+
# SPDX-License-Identifier: MIT
4+
5+
set -ex -o pipefail
6+
7+
REPO=objectionary/on-the-origin-of-objects
8+
9+
TLROOT=$(kpsewhich -var-value TEXMFDIST)
10+
11+
rm -rf package
12+
mkdir package
13+
cd package
14+
cp ../paper.tex .
15+
cp ../goto-pic.pdf .
16+
mkdir bibliography
17+
cp ../bibliography/main.bib bibliography/main.bib
18+
for p in ffcode to-be-determined href-ul eolang iexec; do
19+
cp "${TLROOT}/tex/latex/${p}/${p}.sty" .
20+
done
21+
22+
version=$(curl --silent -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${REPO}/releases/latest" | jq -r '.tag_name')
23+
echo "Version is: ${version}"
24+
gsed -i "s|0\.0\.0|${version}|g" paper.tex
25+
gsed -i "s|REPOSITORY|${REPO}|g" paper.tex
26+
pdflatex -interaction=errorstopmode -halt-on-error -shell-escape paper.tex
27+
bibtex paper
28+
pdflatex -interaction=errorstopmode -halt-on-error paper.tex > /dev/null
29+
pdflatex -interaction=errorstopmode -halt-on-error paper.tex > /dev/null
30+
rm -rf ./*.aux ./*.bcf ./*.blg ./*.fdb_latexmk ./*.fls ./*.log ./*.run.xml ./*.out ./*.exc
31+
zip -x paper.pdf -r "paper-${version}.zip" ./*
32+
mv "paper-${version}.zip" ..
33+
cd ..

0 commit comments

Comments
 (0)