diff --git a/plugins/common/functions b/plugins/common/functions index 7359a980a..716eced85 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -4,6 +4,10 @@ set -eo pipefail has_tty() { declare desc="return 0 if we have a tty" + if [[ "$DOKKU_FORCE_TTY" == "true" ]]; then + return 0 + fi + if [[ "$DOKKU_DISABLE_TTY" == "true" ]]; then return 1 fi diff --git a/plugins/run/help-functions b/plugins/run/help-functions index ec2835771..c20ec4746 100755 --- a/plugins/run/help-functions +++ b/plugins/run/help-functions @@ -28,7 +28,7 @@ fn-help-content() { declare desc="return help content" cat < , Run a command in a new container using the current app image - run:detached [-e|-env KEY=VALUE] [--no-tty] , Run a command in a new detached container using the current app image + run:detached [-e|-env KEY=VALUE] [--no-tty|--force-tty] , Run a command in a new detached container using the current app image run:list [--format json|stdout] , List all run containers for an app run:logs [-h] [-t] [-n num] [-q], Display recent log output for run containers run:stop , Stops all run containers for an app or a specified run container diff --git a/plugins/run/internal-functions b/plugins/run/internal-functions index 28f564328..a09694c66 100755 --- a/plugins/run/internal-functions +++ b/plugins/run/internal-functions @@ -21,6 +21,10 @@ fn-run() { export DOKKU_DISABLE_TTY=true shift ;; + --force-tty) + export DOKKU_FORCE_TTY=true + shift + ;; --cron-id) if [[ ! $2 ]]; then dokku_log_warn "expected $1 to have an argument" @@ -50,6 +54,10 @@ fn-run() { esac done + if [[ "$DOKKU_DISABLE_TTY" == "true" ]] && [[ "$DOKKU_FORCE_TTY" == "true" ]]; then + dokku_log_fail "Cannot specify both --force-tty and --no-tty" + fi + verify_app_name "$APP" local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")