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

Put a minor check before writing config

This commit is contained in:
Shane Kilkelly 2020-06-16 13:20:30 +01:00
parent 761728b11d
commit 8b6d94fe81

View file

@ -2,6 +2,13 @@
set -euo pipefail
function check_existing_config() {
if [[ -f ./config/overleaf.rc ]] || [[ -f ./config/variables.env ]]; then
echo "ERROR: Config files already exist, exiting "
exit 1
fi
}
function set_up_config_files() {
echo "Copying config files"
cp ./examples/*.yml ./config/
@ -10,8 +17,7 @@ function set_up_config_files() {
}
function __main__() {
# TODO:
# - check if the user wants to overwrite existing config
check_existing_config
set_up_config_files
}