mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 23:38:06 +02:00
Fix pathing in bin/logs and bin/error-logs
This commit is contained in:
parent
52d5313d98
commit
a673618a24
2 changed files with 20 additions and 2 deletions
|
@ -2,6 +2,15 @@
|
|||
|
||||
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 usage() {
|
||||
echo "Usage: bin/error-logs [OPTIONS] [SERVICES...]"
|
||||
echo ""
|
||||
|
@ -32,7 +41,7 @@ function __main__() {
|
|||
exit
|
||||
fi
|
||||
# preserve the '==>' labels from tail output
|
||||
bin/logs "$@" | grep -E '(^==>.*$|^.*level":50.*$)' --color=never
|
||||
"$TOOLKIT_ROOT/bin/logs" "$@" | grep -E '(^==>.*$|^.*level":50.*$)' --color=never
|
||||
}
|
||||
|
||||
__main__ "$@"
|
||||
|
|
11
bin/logs
11
bin/logs
|
@ -2,6 +2,15 @@
|
|||
|
||||
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
|
||||
|
||||
DEFAULT_LINES=20
|
||||
|
||||
function usage() {
|
||||
|
@ -65,7 +74,7 @@ function __main__() {
|
|||
|
||||
bash_exec_command_string="tail $FOLLOW_FLAG -n $LINES $path_spec"
|
||||
|
||||
exec ./bin/docker-compose exec sharelatex bash -c "$bash_exec_command_string"
|
||||
exec "$TOOLKIT_ROOT/bin/docker-compose" exec sharelatex bash -c "$bash_exec_command_string"
|
||||
}
|
||||
|
||||
__main__ "$@"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue