mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 15:28:06 +02:00
Move prompt for rebranding into helper function
This commit is contained in:
parent
2240ab1f71
commit
2a40dc3055
4 changed files with 6 additions and 7 deletions
|
@ -33,7 +33,6 @@ function __main__() {
|
|||
|
||||
echo "This script will update your config/variables.env."
|
||||
echo "We recommend backing up your config with bin/backup-config."
|
||||
prompt "Do you want to continue?"
|
||||
|
||||
rebrand_sharelatex_env_variables 'variables.env'
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ function __main__() {
|
|||
|
||||
echo "This script will update your config/overleaf.rc."
|
||||
echo "We recommend backing up your config with bin/backup-config."
|
||||
prompt "Do you want to continue?"
|
||||
|
||||
rebrand_sharelatex_env_variables 'overleaf.rc'
|
||||
|
||||
|
|
|
@ -171,8 +171,6 @@ function handle_image_upgrade() {
|
|||
cp "$TOOLKIT_ROOT/lib/config-seed/version" "$TOOLKIT_ROOT/config/version"
|
||||
|
||||
if [[ "$IMAGE_VERSION_MAJOR" -le 4 && "$SEED_IMAGE_VERSION_MAJOR" -ge 5 ]]; then
|
||||
echo "Renaming environment variables in config/variables.env and config/overleaf.rc"
|
||||
prompt "Proceed with the environment variable renaming?"
|
||||
rebrand_sharelatex_env_variables 'variables.env'
|
||||
fi
|
||||
|
||||
|
|
|
@ -32,10 +32,13 @@ rebrand_sharelatex_env_variables() {
|
|||
sharelatex_occurrences=$(set +o pipefail && grep -o "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 $filename"
|
||||
echo " Found $sharelatex_occurrences lines with SHARELATEX_ in config/$filename"
|
||||
local timestamp=$(date "+%Y.%m.%d-%H.%M.%S")
|
||||
echo " Creating backup file config/__old-$filename.$timestamp"
|
||||
cp config/$filename config/__old-$filename.$timestamp
|
||||
local backup_filename="__old-$filename.$timestamp"
|
||||
echo " Will create backup of config/$filename at config/$backup_filename"
|
||||
prompt " Proceed with the renaming in config/$filename?"
|
||||
echo " Creating backup file config/$backup_filename"
|
||||
cp "$TOOLKIT_ROOT/config/$filename" "$TOOLKIT_ROOT/config/$backup_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 config/$filename"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue