From 4536fd5190a899118dc8f1660ba36a7134eca370 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 29 Nov 2020 18:23:55 -0800 Subject: [PATCH] appease shellcheck --- bin/docs/example-to-doc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/docs/example-to-doc b/bin/docs/example-to-doc index ebb608d6..60ce8590 100755 --- a/bin/docs/example-to-doc +++ b/bin/docs/example-to-doc @@ -1,11 +1,11 @@ #!/bin/sh export EXAMPLE=$1 -export EXNAME=`echo ${EXAMPLE} |cut -c 3-` -cd examples; \ -install -d dirname ${EXAMPLE} -echo "# ${EXNAME}\n\`\`\` c++\n" > ${EXAMPLE}.md -cat ../../examples/${EXAMPLE} >> ${EXAMPLE}.md -echo "\n\`\`\`" >> ${EXAMPLE}.md +EXNAME=$(echo "${EXAMPLE}" |cut -c 3) +cd examples ||exit; \ +install -d dirname "${EXAMPLE}" +printf "# %s\n\`\`\` c++\n", "${EXNAME}" > "${EXAMPLE}.md" +cat ../../examples/"${EXAMPLE}" >> "${EXAMPLE}.md" +printf '\n```' >> "${EXAMPLE}.md"