Skip to content

Commit f7a6748

Browse files
committed
add bad link check
fixes #54
1 parent 684df14 commit f7a6748

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/compile.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v4
2525
with:
2626
repository: devnull-cz/unix-linux-prog-in-c-src
27-
path: src
27+
path: unix-linux-prog-in-c-src
2828
- name: Install pre-requisites for LaTeX
2929
working-directory: master
3030
run: ./dev/install-latex.sh
@@ -40,3 +40,6 @@ jobs:
4040
- name: Compile
4141
working-directory: master
4242
run: make slides notes
43+
- name: Check example links
44+
working-directory: master
45+
run: ./dev/check-examples.sh

dev/check-examples.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#
3+
# Verify the \example{} are all valid links to the source repository.
4+
#
5+
# Assumes the source repository is checked about to the '../unix-linux-prog-in-c-src' directory
6+
# and also that the TeX documents were already processed by m4.
7+
#
8+
# Lastly, it assumes that the \example{} does not span multiple lines.
9+
#
10+
11+
for m4file in *.m4.tex; do
12+
echo "### $m4file"
13+
cat "$m4file" | grep -o '\\example{[[:alnum:]\/\._\-]\+}' | \
14+
sort -u | sed -e 's/^\\example{//' -e 's/}$//' | while read example; do
15+
if [[ ! -f ../unix-linux-prog-in-c-src/$example ]]; then
16+
echo "example $example is bad link"
17+
exit 1
18+
fi
19+
done
20+
done

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy