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

Fix pathing in a bunch of bin scripts

This commit is contained in:
Shane Kilkelly 2020-07-16 09:48:00 +01:00
parent 161b3591c5
commit 30b3e6106c
3 changed files with 30 additions and 4 deletions

View file

@ -2,8 +2,17 @@
set -euo pipefail
#### Detect Toolkit Project Root ####
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
TOOLKIT_ROOT="$(realpath "$SCRIPT_DIR/..")"
if [[ ! -d "$TOOLKIT_ROOT/bin" ]] || [[ ! -d "$TOOLKIT_ROOT/config" ]]; then
echo "ERROR: could not find root of overleaf-toolkit project (inferred project root as '$TOOLKIT_ROOT')"
exit 1
fi
function __main__() {
exec ./bin/docker-compose start "$@"
exec "$TOOLKIT_ROOT/bin/docker-compose" start "$@"
}
__main__ "$@"

View file

@ -1,9 +1,17 @@
#! /usr/bin/env bash
set -euo pipefail
#### Detect Toolkit Project Root ####
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
TOOLKIT_ROOT="$(realpath "$SCRIPT_DIR/..")"
if [[ ! -d "$TOOLKIT_ROOT/bin" ]] || [[ ! -d "$TOOLKIT_ROOT/config" ]]; then
echo "ERROR: could not find root of overleaf-toolkit project (inferred project root as '$TOOLKIT_ROOT')"
exit 1
fi
function __main__() {
exec ./bin/docker-compose stop "$@"
exec "$TOOLKIT_ROOT/bin/docker-compose" stop "$@"
}
__main__ "$@"

13
bin/up
View file

@ -1,9 +1,18 @@
#! /usr/bin/env bash
set -euo pipefail
#### Detect Toolkit Project Root ####
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
TOOLKIT_ROOT="$(realpath "$SCRIPT_DIR/..")"
if [[ ! -d "$TOOLKIT_ROOT/bin" ]] || [[ ! -d "$TOOLKIT_ROOT/config" ]]; then
echo "ERROR: could not find root of overleaf-toolkit project (inferred project root as '$TOOLKIT_ROOT')"
exit 1
fi
function check_config() {
if [[ ! -f config/overleaf.rc ]] || [[ ! -f config/variables.env ]]; then
if [[ ! -f "$TOOLKIT_ROOT/config/overleaf.rc" ]] \
|| [[ ! -f "$TOOLKIT_ROOT/config/variables.env" ]]; then
echo "Config files not found! exiting"
exit 1
fi
@ -11,7 +20,7 @@ function check_config() {
function __main__() {
check_config
exec ./bin/docker-compose up
exec "$TOOLKIT_ROOT/bin/docker-compose" up
}
__main__ "$@"