From 9ddc0120cb4acd40da6f1384fcc608bed875ae8e Mon Sep 17 00:00:00 2001 From: Hendy Irawan Date: Wed, 19 Feb 2020 23:38:16 +0700 Subject: [PATCH] Workaround for https://github.com/docker/for-win/issues/1588 --- dbench | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dbench b/dbench index 49bbc625..761a1148 100755 --- a/dbench +++ b/dbench @@ -3,11 +3,21 @@ function run () { user=$1 shift - docker exec -itu "${user}" frappe bash -c "$@" + if [ -f '/usr/bin/winpty' ]; then + # Workaround for https://github.com/docker/for-win/issues/1588 + /usr/bin/winpty docker exec -itu "${user}" frappe bash -c "$@" + else + docker exec -itu "${user}" frappe bash -c "$@" + fi } if [[ $# -eq 0 ]]; then - docker exec -it frappe bash + if [ -f '/usr/bin/winpty' ]; then + # Workaround for https://github.com/docker/for-win/issues/1588 + /usr/bin/winpty docker exec -it frappe bash + else + docker exec -it frappe bash + fi elif [[ "$1" == 'init' ]]; then run root "chown -R frappe:frappe /home/frappe" run frappe "cd .. && bench init frappe-bench --ignore-exist --skip-redis-config-generation && cd frappe-bench"