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:
parent
161b3591c5
commit
30b3e6106c
3 changed files with 30 additions and 4 deletions
11
bin/start
11
bin/start
|
@ -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__ "$@"
|
||||
|
|
10
bin/stop
10
bin/stop
|
@ -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
13
bin/up
|
@ -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__ "$@"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue