Skip to content
Snippets Groups Projects
Verified Commit 0954d2c2 authored by Romain Deville's avatar Romain Deville
Browse files

:pencil2: Fix typos in setup.sh

parent 3be88b7b
No related branches found
No related tags found
No related merge requests found
...@@ -556,8 +556,9 @@ EOM ...@@ -556,8 +556,9 @@ EOM
esac esac
begin="${prefix} ${begin_tag} ${suffix}" begin="${prefix} ${begin_tag} ${suffix}"
end="${prefix} ${end_tag} ${suffix}" end="${prefix} ${end_tag} ${suffix}"
warning="${prefix} WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !${suffix}\n" warning="\
warning+="${prefix} Modified content will be overwritten when updating.${suffix}\n" ${prefix} WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !${suffix}
${prefix} Modified content will be overwritten when updating.${suffix}"
for i_file in "${tmp_file_from}" "${tmp_file_to}" for i_file in "${tmp_file_from}" "${tmp_file_to}"
do do
...@@ -571,11 +572,12 @@ EOM ...@@ -571,11 +572,12 @@ EOM
then then
if ! grep "${begin}" "${file_from}" &>/dev/null if ! grep "${begin}" "${file_from}" &>/dev/null
then then
content="${begin}\n" content="\
content+="${warning}\n" ${begin}
content+="$(cat "${file_from}")" ${warning}
content+="\n\n${end}" $(cat "${file_from}")
echo -e "${content}" > "${tmp_file_from}" ${end}"
echo "${content}" > "${tmp_file_from}"
else else
sed -n -e "/${begin_tag}/,/${end_tag}/"p "${file_from}" > "${tmp_file_from}" sed -n -e "/${begin_tag}/,/${end_tag}/"p "${file_from}" > "${tmp_file_from}"
fi fi
...@@ -591,6 +593,7 @@ EOM ...@@ -591,6 +593,7 @@ EOM
fi fi
cp "${file_to}" "${bak_file}" cp "${file_to}" "${bak_file}"
mkdocs_log "INFO" "AAAAAAA Upgrading file **${relative_file_to}**."
grep -B 1000000 "${begin}" "${file_to}" | sed -e "s/${begin}//g" > "${tmp_file_to}" grep -B 1000000 "${begin}" "${file_to}" | sed -e "s/${begin}//g" > "${tmp_file_to}"
cat "${tmp_file_from}" >> "${tmp_file_to}" cat "${tmp_file_from}" >> "${tmp_file_to}"
grep -A 1000000 "${end}" "${file_to}" | sed -e "s/${end}//g" >> "${tmp_file_to}" grep -A 1000000 "${end}" "${file_to}" | sed -e "s/${end}//g" >> "${tmp_file_to}"
...@@ -639,6 +642,8 @@ EOM ...@@ -639,6 +642,8 @@ EOM
local relative_file_to="${file_to##*${MKDOCS_ROOT}\/}" local relative_file_to="${file_to##*${MKDOCS_ROOT}\/}"
local begin="" local begin=""
local end="" local end=""
local begin_tag="BEGIN MKDOCS TEMPLATE"
local end_tag="END MKDOCS TEMPLATE"
local warning="" local warning=""
local prefix="" local prefix=""
local suffix="" local suffix=""
...@@ -661,17 +666,19 @@ EOM ...@@ -661,17 +666,19 @@ EOM
suffix="###" suffix="###"
;; ;;
esac esac
begin="${prefix} BEGIN MKDOCS TEMPLATE ${suffix}" begin="${prefix} ${begin_tag} ${suffix}"
end="${prefix} END MKDOCS TEMPLATE ${suffix}" end="${prefix} ${end_tag} ${suffix}"
warning="${prefix} WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !${suffix}\n" warning="\
warning+="${prefix} Modified content will be overwritten when updating.${suffix}\n" ${prefix} WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !${suffix}
${prefix} Modified content will be overwritten when updating.${suffix}"
if [[ -n "${prefix}" ]] && ! grep "${begin}" "${file_from}" &>/dev/null if [[ -n "${prefix}" ]] && ! grep "${begin}" "${file_from}" &>/dev/null
then then
content="${begin}\n" content="\
content+="${warning}\n" ${begin}
content+="$(cat "${file_from}")" ${warning}
content+="\n\n${end}" $(cat "${file_from}")
echo -e "${content}" > "${file_to}" ${end}"
echo "${content}" > "${file_to}"
else else
cp "${file_from}" "${file_to}" cp "${file_from}" "${file_to}"
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment