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

more specific sharelatex_occurrences in shared-functions.sh

ignoring occurences in e.g. comments seems to be advisable
This commit is contained in:
Pfiffikus 2024-05-21 11:35:10 +02:00 committed by GitHub
parent 5f7f356ae3
commit 839ba772d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,7 +53,7 @@ prompt() {
rebrand_sharelatex_env_variables() {
local filename=$1
local silent=${2:-no}
sharelatex_occurrences=$(set +o pipefail && grep -o "SHARELATEX_" "$TOOLKIT_ROOT/config/$filename" | wc -l | sed 's/ //g')
sharelatex_occurrences=$(set +o pipefail && grep -oE "^[ ]*SHARELATEX_" "$TOOLKIT_ROOT/config/$filename" | wc -l | sed 's/ //g')
if [ "$sharelatex_occurrences" -gt 0 ]; then
echo "Rebranding from ShareLaTeX to Overleaf"
echo " Found $sharelatex_occurrences lines with SHARELATEX_ in config/$filename"