1
0
Fork 0
mirror of https://github.com/overleaf/toolkit.git synced 2025-04-19 23:38:06 +02:00

Group output from rebranding process

This commit is contained in:
Jakob Ackermann 2024-02-26 11:45:42 +00:00
parent d3188d9c4d
commit 2240ab1f71
No known key found for this signature in database
GPG key ID: 30C56800FCA3828A

View file

@ -31,16 +31,18 @@ rebrand_sharelatex_env_variables() {
local silent=${2:-no}
sharelatex_occurrences=$(set +o pipefail && grep -o "SHARELATEX_" "$TOOLKIT_ROOT/config/$filename" | wc -l | sed 's/ //g')
if [ "$sharelatex_occurrences" -gt 0 ]; then
echo "Found $sharelatex_occurrences lines with SHARELATEX_ in $filename"
echo "Rebranding from ShareLaTeX to Overleaf"
echo " Found $sharelatex_occurrences lines with SHARELATEX_ in $filename"
local timestamp=$(date "+%Y.%m.%d-%H.%M.%S")
echo "Creating backup file config/__old-$filename.$timestamp"
echo " Creating backup file config/__old-$filename.$timestamp"
cp config/$filename config/__old-$filename.$timestamp
echo "Replacing 'SHARELATEX_' with 'OVERLEAF_' in config/$filename"
echo " Replacing 'SHARELATEX_' with 'OVERLEAF_' in config/$filename"
sed -i "s/SHARELATEX_/OVERLEAF_/g" "$TOOLKIT_ROOT/config/$filename"
echo "Updated $sharelatex_occurrences lines in $TOOLKIT_ROOT/config/$filename"
echo " Updated $sharelatex_occurrences lines in config/$filename"
else
if [[ "$silent" != "silent_if_no_match" ]]; then
echo "No 'SHARELATEX_' occurrences found in config/$filename"
echo "Rebranding from ShareLaTeX to Overleaf"
echo " No 'SHARELATEX_' occurrences found in config/$filename"
fi
fi
}