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

Add config checks to doctor and up scripts

This commit is contained in:
Shane Kilkelly 2020-06-05 10:54:44 +01:00
parent 95e3ad9ab9
commit 95fb90b79c
3 changed files with 33 additions and 0 deletions

View file

@ -115,6 +115,28 @@ function print_warnings() {
fi
}
function check_config_files() {
print_section_separator "Configuration"
docker_compose_file="config/docker-compose.yml"
print_sub_point "$docker_compose_file"
if [[ ! -f "$docker_compose_file" ]]; then
print_sub_sub_point "status: MISSING !"
add_warning "configuration file $docker_compose_file not found"
else
print_sub_sub_point "status: present"
fi
local_conf_file="config/local.yml"
print_sub_point "$local_conf_file"
if [[ ! -f "$local_conf_file" ]]; then
print_sub_sub_point "status: MISSING !"
add_warning "configuration file $local_conf_file not found"
else
print_sub_sub_point "status: present"
fi
}
function cleanup() {
rm "$WARNINGS_FILE"
}
@ -124,6 +146,7 @@ function __main__() {
check_host_information
check_dependencies
check_docker_daemon
check_config_files
print_warnings
print_section_separator "End"
cleanup

View file

@ -9,6 +9,8 @@ function set_up_config_files() {
}
function __main__() {
# TODO:
# - check if the user wants to overwrite existing config
set_up_config_files
}

8
bin/up
View file

@ -2,7 +2,15 @@
set -euo pipefail
function check_config() {
if [[ ! -f config/docker-compose.yml ]] || [[ ! -f config/local.yml ]]; then
echo "Config files not found! exiting"
exit 1
fi
}
function __main__() {
check_config
exec ./bin/docker-compose up
}