From 117bb1d2cf988bd1e9da195341b94eb98240f222 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 18 Aug 2016 10:49:46 -0400 Subject: [PATCH] Add a script that hooks the nostarch build commands together --- .gitignore | 1 + nostarch.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 nostarch.sh diff --git a/.gitignore b/.gitignore index 7851fa0..4c699f4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ book/ .idea .DS_Store target +tmp diff --git a/nostarch.sh b/nostarch.sh new file mode 100755 index 0000000..0ad90de --- /dev/null +++ b/nostarch.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -eu + +mkdir -p tmp + +# Get all the markdown files in the src dir, +ls src/*.md | \ +# except for SUMMARY.md. +grep -v SUMMARY.md | \ +# Extract just the filename so we can reuse it easily. +xargs -n 1 basename | \ +# Change all the links from markdown to italicized inline text. +while IFS= read -r filename; do + cargo run --bin link2print < "src/$filename" > "tmp/$filename" +done +# Concat the files into the nostarch dir. +cargo run --bin concat_chapters tmp nostarch