mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 23:38:06 +02:00
Refuse to start with mismatching ShareLaTeX vs Overleaf branded configs
This commit is contained in:
parent
2a40dc3055
commit
8fbe2be217
1 changed files with 21 additions and 12 deletions
|
@ -22,11 +22,15 @@ function check_sharelatex_env_vars() {
|
|||
local rc_occurrences=$(set +o pipefail && grep -o SHARELATEX_ "$TOOLKIT_ROOT/config/overleaf.rc" | wc -l | sed 's/ //g')
|
||||
|
||||
if [ "$rc_occurrences" -gt 0 ]; then
|
||||
echo "WARNING: some runtime variables defined in config/overleaf.rc"
|
||||
echo "contain 'SHARELATEX_' in their name. The variables should be"
|
||||
echo "renamed to 'OVERLEAF_'."
|
||||
echo "you can upgrade your config/overleaf.rc by running bin/rename-rc-vars"
|
||||
prompt "Do you want to continue?"
|
||||
echo "Rebranding from ShareLaTeX to Overleaf"
|
||||
echo " The Toolkit has adopted to Overleaf brand for its variables."
|
||||
echo " Your config/overleaf.rc still has variables using the previous ShareLaTeX brand."
|
||||
echo " Moving forward the 'SHARELATEX_' prefixed variables must be renamed to 'OVERLEAF_'."
|
||||
echo " You can migrate your config/overleaf.rc to use the Overleaf brand by running:"
|
||||
echo ""
|
||||
echo " toolkit$ bin/rename-rc-vars"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local invalid_prefix="SHARELATEX_"
|
||||
|
@ -37,13 +41,18 @@ function check_sharelatex_env_vars() {
|
|||
local env_occurrences=$(set +o pipefail && grep -o "$invalid_prefix" "$TOOLKIT_ROOT/config/variables.env" | wc -l | sed 's/ //g')
|
||||
|
||||
if [ "$env_occurrences" -gt 0 ]; then
|
||||
echo "WARNING: some environment variables defined in config/variables.env"
|
||||
echo "contain '$invalid_prefix' in their name"
|
||||
echo "Starting with Overleaf CE and Server Pro 5.0.0 the environment variables"
|
||||
echo "use the prefix 'OVERLEAF_' instead of 'SHARELATEX_'."
|
||||
echo "Please check your config/version, and config/variables.env files,"
|
||||
echo "you can upgrade your config/variables.env to use 'OVERLEAF_' by running bin/rename-env-vars-5-0"
|
||||
prompt "Do you want to continue?"
|
||||
echo "Rebranding from ShareLaTeX to Overleaf"
|
||||
echo " Starting with Overleaf CE and Server Pro version 5.0.0 the environment variables will use the Overleaf brand."
|
||||
echo " Previous versions used the ShareLaTeX brand for environment variables."
|
||||
echo " Your config/variables.env has $env_occurrences entries matching '$invalid_prefix'."
|
||||
echo " Please align your config/version with the naming scheme of variables in config/variables.env."
|
||||
if [[ ! "$IMAGE_VERSION_MAJOR" -lt 5 ]]; then
|
||||
echo " You can migrate your config/variables.env to use the Overleaf brand by running:"
|
||||
echo ""
|
||||
echo " toolkit$ bin/rename-env-vars-5-0"
|
||||
echo ""
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue