nixos/doc/md-to-db.sh: handle path to nixpkgs with spaces
Without this change, the script will fail if the path to nixpkgs contains a space.
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
# into DocBook files in the from_md folder.
|
# into DocBook files in the from_md folder.
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
pushd $DIR
|
pushd "$DIR"
|
||||||
|
|
||||||
# NOTE: Keep in sync with Nixpkgs manual (/doc/Makefile).
|
# NOTE: Keep in sync with Nixpkgs manual (/doc/Makefile).
|
||||||
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
|
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
|
||||||
@@ -29,7 +29,7 @@ mapfile -t MD_FILES < <(find . -type f -regex '.*\.md$')
|
|||||||
|
|
||||||
for mf in ${MD_FILES[*]}; do
|
for mf in ${MD_FILES[*]}; do
|
||||||
if [ "${mf: -11}" == ".section.md" ]; then
|
if [ "${mf: -11}" == ".section.md" ]; then
|
||||||
mkdir -p $(dirname "$OUT/$mf")
|
mkdir -p "$(dirname "$OUT/$mf")"
|
||||||
OUTFILE="$OUT/${mf%".section.md"}.section.xml"
|
OUTFILE="$OUT/${mf%".section.md"}.section.xml"
|
||||||
pandoc "$mf" "${pandoc_flags[@]}" \
|
pandoc "$mf" "${pandoc_flags[@]}" \
|
||||||
-o "$OUTFILE"
|
-o "$OUTFILE"
|
||||||
@@ -37,7 +37,7 @@ for mf in ${MD_FILES[*]}; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${mf: -11}" == ".chapter.md" ]; then
|
if [ "${mf: -11}" == ".chapter.md" ]; then
|
||||||
mkdir -p $(dirname "$OUT/$mf")
|
mkdir -p "$(dirname "$OUT/$mf")"
|
||||||
OUTFILE="$OUT/${mf%".chapter.md"}.chapter.xml"
|
OUTFILE="$OUT/${mf%".chapter.md"}.chapter.xml"
|
||||||
pandoc "$mf" "${pandoc_flags[@]}" \
|
pandoc "$mf" "${pandoc_flags[@]}" \
|
||||||
--top-level-division=chapter \
|
--top-level-division=chapter \
|
||||||
|
|||||||
Reference in New Issue
Block a user