From 64a43400378c621c0f231b79cc057125145c3430 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 10 Sep 2017 01:20:58 -0400 Subject: [PATCH] feat: add support for --tail --- common-functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common-functions b/common-functions index e96e658..455b175 100755 --- a/common-functions +++ b/common-functions @@ -349,14 +349,14 @@ service_list() { service_logs() { declare desc="Displays logs for a service" - declare SERVICE="$1" + declare SERVICE="$1" TAIL_FLAG="$2" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local ID=$(cat "$SERVICE_ROOT/ID") + local RE_INTEGER='^[0-9]+$' - if [[ $2 == "-t" ]]; then + DOKKU_LOGS_ARGS="--tail 100" + if [[ "$TAIL_FLAG" == "-t" ]] || [[ "$TAIL_FLAG" == "--tail" ]]; then DOKKU_LOGS_ARGS="--follow" - else - DOKKU_LOGS_ARGS="--tail 100" fi # shellcheck disable=SC2086