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:
parent
761728b11d
commit
8b6d94fe81
1 changed files with 8 additions and 2 deletions
10
bin/init
10
bin/init
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue