1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Ensure we clean up after attempting to find a shell

This commit is contained in:
Joe Groocock 2017-08-27 16:40:58 +01:00
parent 8a3fd3c61a
commit 3faf6504bc
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -196,6 +196,10 @@ _dsh() {
if [ -z "$prog" ]; then if [ -z "$prog" ]; then
set -o pipefail set -o pipefail
local rm=
if [ "$dowhat" = 'run' ]; then
rm='--rm --entrypoint='
fi
for shell in bash sh; do for shell in bash sh; do
if shell_path="$(eval "docker $dowhat $rm $host which $shell" <&- | sed 's|[\r\n]||g')"; then if shell_path="$(eval "docker $dowhat $rm $host which $shell" <&- | sed 's|[\r\n]||g')"; then
prog="$shell_path" prog="$shell_path"