use tty cmd to detect if we have one. closes #921

This commit is contained in:
Michael Hobbs
2015-01-24 20:00:06 -08:00
parent 013eafd8df
commit 4ad0c3022e

View File

@@ -49,8 +49,8 @@ case "$1" in
shift 2
DOCKER_ARGS=$(: | pluginhook docker-args $APP run)
# if we have a prompt, then we have a tty according to the LDP (http://www.tldp.org/LDP/abs/html/intandnonint.html)
[[ ! -z "$PS1" ]] && DOKKU_RUN_OPTS="-i -t"
[[ "$(/usr/bin/tty || true)" != "not a tty" ]] && DOKKU_RUN_OPTS="-i -t"
docker run $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE /exec "$@"
;;