From 19f92c51021b964ed5b6676825293686d5a57423 Mon Sep 17 00:00:00 2001 From: Ned Bingham Date: Sat, 3 Jun 2023 12:26:51 +0000 Subject: [PATCH] detecting current directory and passing it through --- bcli-develop.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bcli-develop.sh b/bcli-develop.sh index 7bb9d5c..d13eca3 100644 --- a/bcli-develop.sh +++ b/bcli-develop.sh @@ -24,8 +24,12 @@ bcli() { umount $HOME/tech fi rmdir $HOME/tech - elif [ "$#" -eq 0 ]; then - docker exec -u $(id -u) -it "bcli-$USER" /bin/bash + elif [ "$#" -eq 0 ]; then + WD="/host" + if [[ "$PWD" = "$HOME/"* ]]; then + WD="/host${PWD#$HOME}" + fi + docker exec -u $(id -u) -w $WD -it "bcli-$USER" /bin/bash else if [ "$1" != "--help" ]; then echo "error: unrecognized command '$1'"