From 7938ea67a717e69d00edab8c2cb6f04c9c469aaf Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sat, 9 Oct 2021 19:08:25 +0200 Subject: [PATCH] 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. --- nixos/doc/manual/md-to-db.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/md-to-db.sh b/nixos/doc/manual/md-to-db.sh index 6dd4b8c6e419..e0274f5619c7 100755 --- a/nixos/doc/manual/md-to-db.sh +++ b/nixos/doc/manual/md-to-db.sh @@ -6,7 +6,7 @@ # into DocBook files in the from_md folder. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -pushd $DIR +pushd "$DIR" # NOTE: Keep in sync with Nixpkgs manual (/doc/Makefile). # 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 if [ "${mf: -11}" == ".section.md" ]; then - mkdir -p $(dirname "$OUT/$mf") + mkdir -p "$(dirname "$OUT/$mf")" OUTFILE="$OUT/${mf%".section.md"}.section.xml" pandoc "$mf" "${pandoc_flags[@]}" \ -o "$OUTFILE" @@ -37,7 +37,7 @@ for mf in ${MD_FILES[*]}; do fi if [ "${mf: -11}" == ".chapter.md" ]; then - mkdir -p $(dirname "$OUT/$mf") + mkdir -p "$(dirname "$OUT/$mf")" OUTFILE="$OUT/${mf%".chapter.md"}.chapter.xml" pandoc "$mf" "${pandoc_flags[@]}" \ --top-level-division=chapter \