mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 23:38:06 +02:00
add timestamp to backup file
This commit is contained in:
parent
335c94886a
commit
8b9fc04f55
2 changed files with 6 additions and 4 deletions
|
@ -36,8 +36,9 @@ function __main__() {
|
|||
echo "We recommend backing up your config with bin/backup-config."
|
||||
prompt "Do you want to continue?"
|
||||
|
||||
echo "Creating backup file config/__old-variables.env"
|
||||
cp config/variables.env config/__old-variables.env
|
||||
local timestamp=$(date "+%Y.%m.%d-%H.%M.%S")
|
||||
echo "Creating backup file config/__old-variables.env.$timestamp"
|
||||
cp config/variables.env config/__old-variables.env.$timestamp
|
||||
|
||||
echo "Replacing 'SHARELATEX_' with 'OVERLEAF_' in config/variables.env"
|
||||
sed -i "s/SHARELATEX_/OVERLEAF_/g" "$TOOLKIT_ROOT/config/variables.env"
|
||||
|
|
|
@ -161,8 +161,9 @@ function handle_image_upgrade() {
|
|||
if [[ "$IMAGE_VERSION_MAJOR" -le 4 && "$SEED_IMAGE_VERSION_MAJOR" -ge 5 ]]; then
|
||||
echo "Renaming environment variables in config/variables.env"
|
||||
prompt "Proceed with the environment variable renaming?"
|
||||
echo "Backing up old variables.env file to config/__old-variables.env"
|
||||
cp "$TOOLKIT_ROOT/config/variables.env" "$TOOLKIT_ROOT/config/__old-variables.env"
|
||||
local timestamp=$(date "+%Y.%m.%d-%H.%M.%S")
|
||||
echo "Backing up old variables.env file to config/__old-variables.env.$timestamp"
|
||||
cp "$TOOLKIT_ROOT/config/variables.env" "$TOOLKIT_ROOT/config/__old-variables.env.$timestamp"
|
||||
sed -i "s/SHARELATEX_/OVERLEAF_/g" "$TOOLKIT_ROOT/config/variables.env"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue