mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
docs: use printf for Makefile:copy-docs section (#4548)
printf handles new line char for cross-platform use
This commit is contained in:
parent
ab2d184e42
commit
1b49b58677
1 changed files with 4 additions and 2 deletions
6
Makefile
6
Makefile
|
@ -478,16 +478,18 @@ check-licenses: install-wwhrd
|
||||||
wwhrd check -f .wwhrd.yml
|
wwhrd check -f .wwhrd.yml
|
||||||
|
|
||||||
copy-docs:
|
copy-docs:
|
||||||
|
# The 'printf' function is used instead of 'echo' or 'echo -e' to handle line breaks (e.g. '\n') in the same way on different operating systems (MacOS/Ubuntu Linux/Arch Linux) and their shells (bash/sh/zsh/fish).
|
||||||
|
# For details, see https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4548#issue-1782796419 and https://stackoverflow.com/questions/8467424/echo-newline-in-bash-prints-literal-n
|
||||||
echo "---" > ${DST}
|
echo "---" > ${DST}
|
||||||
@if [ ${ORDER} -ne 0 ]; then \
|
@if [ ${ORDER} -ne 0 ]; then \
|
||||||
echo "sort: ${ORDER}" >> ${DST}; \
|
echo "sort: ${ORDER}" >> ${DST}; \
|
||||||
echo "weight: ${ORDER}" >> ${DST}; \
|
echo "weight: ${ORDER}" >> ${DST}; \
|
||||||
echo "menu:\n docs:\n parent: 'victoriametrics'\n weight: ${ORDER}" >> ${DST}; \
|
printf "menu:\n docs:\n parent: 'victoriametrics'\n weight: ${ORDER}\n" >> ${DST}; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "title: ${TITLE}" >> ${DST}
|
echo "title: ${TITLE}" >> ${DST}
|
||||||
@if [ ${OLD_URL} ]; then \
|
@if [ ${OLD_URL} ]; then \
|
||||||
echo "aliases:\n - ${OLD_URL}" >> ${DST}; \
|
printf "aliases:\n - ${OLD_URL}\n" >> ${DST}; \
|
||||||
fi
|
fi
|
||||||
echo "---" >> ${DST}
|
echo "---" >> ${DST}
|
||||||
cat ${SRC} >> ${DST}
|
cat ${SRC} >> ${DST}
|
||||||
|
|
Loading…
Reference in a new issue