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

10
dbench
View file

@ -3,11 +3,21 @@
function run () {
user=$1
shift
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 [ -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"