Fixed a docker/run current directory issue when invoked with a command to run.

- Legacy-Id: 13819
This commit is contained in:
Henrik Levkowetz 2017-07-09 15:24:34 +00:00
parent 900174ae57
commit ad6f18fbf3

View file

@ -184,9 +184,9 @@ image=$(docker ps | grep "$REPO:$TAG" | awk '{ print $1 }')
if [ "$image" ]; then
if [ "$*" ]; then
echo "Running 'cd ~/${parent#$HOME/}; $*'"
docker exec -u "$WHO" -t $image bash -c "cd '~/${parent#$HOME/}'; $*"
docker exec -u "$WHO" -t $image bash -i -c "cd; cd \"${parent#$HOME/}\"; $*"
else
docker exec -u "$WHO" -ti $image bash
docker exec -u "$WHO" -ti $image bash -i
fi
else
echo ""