Skip to content

Commit 117bb1d

Browse files
committed
Add a script that hooks the nostarch build commands together
1 parent 2d3651d commit 117bb1d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ book/
33
.idea
44
.DS_Store
55
target
6+
tmp
67

nostarch.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
mkdir -p tmp
6+
7+
# Get all the markdown files in the src dir,
8+
ls src/*.md | \
9+
# except for SUMMARY.md.
10+
grep -v SUMMARY.md | \
11+
# Extract just the filename so we can reuse it easily.
12+
xargs -n 1 basename | \
13+
# Change all the links from markdown to italicized inline text.
14+
while IFS= read -r filename; do
15+
cargo run --bin link2print < "src/$filename" > "tmp/$filename"
16+
done
17+
# Concat the files into the nostarch dir.
18+
cargo run --bin concat_chapters tmp nostarch

0 commit comments

Comments
 (0)