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

bin/up: pass flags to docker-compose, and help

This commit is contained in:
Shane Kilkelly 2020-10-20 11:39:00 +01:00
parent fa1600623e
commit 6a4625a9fa

15
bin/up
View file

@ -15,6 +15,15 @@ if [[ ! -d "$TOOLKIT_ROOT/bin" ]] || [[ ! -d "$TOOLKIT_ROOT/config" ]]; then
exit 1
fi
function usage() {
echo "Usage: bin/up [FLAGS...]"
echo ""
echo "A wrapper around 'docker-compose up'."
echo ""
echo "This program will pass any extra flags to docker-compose,"
echo "for example: 'bin/up -d' will run in detached mode"
}
function check_config() {
if [[ ! -f "$TOOLKIT_ROOT/config/overleaf.rc" ]] \
|| [[ ! -f "$TOOLKIT_ROOT/config/variables.env" ]]; then
@ -24,8 +33,12 @@ function check_config() {
}
function __main__() {
if [[ "${1:-null}" == "help" ]] || [[ "${1:-null}" == "--help" ]]; then
usage
exit
fi
check_config
exec "$TOOLKIT_ROOT/bin/docker-compose" up
exec "$TOOLKIT_ROOT/bin/docker-compose" up "$@"
}
__main__ "$@"