detecting current directory and passing it through

This commit is contained in:
Edward Arthur Bingham 2023-06-03 12:26:51 +00:00
parent 6ccb1f0d0e
commit 19f92c5102

View File

@ -25,7 +25,11 @@ bcli() {
fi
rmdir $HOME/tech
elif [ "$#" -eq 0 ]; then
docker exec -u $(id -u) -it "bcli-$USER" /bin/bash
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'"