Merge pull request #922 from progrium/921-mh-use-tty-to-detect-tty

use tty cmd to detect if we have one. closes #921
This commit is contained in:
Jose Diaz-Gonzalez
2015-01-25 21:45:13 -05:00

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 "$@"
;;