This commit is contained in:
Hendy Irawan 2020-02-19 23:38:16 +07:00
parent 305ef606ce
commit 9ddc0120cb

14
dbench
View file

@ -3,11 +3,21 @@
function run () { function run () {
user=$1 user=$1
shift 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 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 elif [[ "$1" == 'init' ]]; then
run root "chown -R frappe:frappe /home/frappe" run root "chown -R frappe:frappe /home/frappe"
run frappe "cd .. && bench init frappe-bench --ignore-exist --skip-redis-config-generation && cd frappe-bench" run frappe "cd .. && bench init frappe-bench --ignore-exist --skip-redis-config-generation && cd frappe-bench"