Skip to content

Commit

Permalink
Revert "dosh: convert extra arguments from profile files"
Browse files Browse the repository at this point in the history
This reverts commit c1e1aac.
  • Loading branch information
gportay committed Nov 5, 2024
1 parent a22632a commit 1f1a365
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
16 changes: 8 additions & 8 deletions dosh
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,14 @@ fi
# Set docker executable
read -r -a docker <<<"${sudo:+$DOSH_SUDO }${DOSH_DOCKER[*]}"

# Convert the DOSH_DOCKER_*_EXTRA_OPTS variables to arrays; use a backslash to
# escape whitespace and preserve it.
for i in DOSH_DOCKER_RUN_EXTRA_OPTS DOSH_DOCKER_EXEC_EXTRA_OPTS \
DOSH_DOCKER_BUILD_EXTRA_OPTS DOSH_DOCKER_RMI_EXTRA_OPTS
do
to_array "$i"
done

# Change the current directory
cd "$directory"

Expand All @@ -791,14 +799,6 @@ then
fi
set -euo pipefail

# Convert the DOSH_DOCKER_*_EXTRA_OPTS variables to arrays; use a backslash to
# escape whitespace and preserve it.
for i in DOSH_DOCKER_RUN_EXTRA_OPTS DOSH_DOCKER_EXEC_EXTRA_OPTS \
DOSH_DOCKER_BUILD_EXTRA_OPTS DOSH_DOCKER_RMI_EXTRA_OPTS
do
to_array "$i"
done

# List the images and exit
if [[ ${ls:-} ]]
then
Expand Down
3 changes: 0 additions & 3 deletions doshrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,3 @@ esac
# DOSH_DOCKER_RUN_EXTRA_OPTS+=(--env SSH_AUTH_SOCK)
# DOSH_DOCKER_RUN_EXTRA_OPTS+=(--volume "$SSH_AUTH_SOCK:$SSH_AUTH_SOCK")
#fi

# Left uncommented to make the tests passed.
DOSH_DOCKER_RUN_EXTRA_OPTS="--env FOO=bar\ baz"
10 changes: 0 additions & 10 deletions tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -636,16 +636,6 @@ else
fi
echo

run "Test DOSH_DOCKER_RUN_EXTRA_OPTS environment variable with whitespace in doshrc"
if no_doshrc= dosh -c env 2>&1 | tee /dev/stderr | \
grep -q "^FOO=bar baz$"
then
ok
else
ko
fi
echo

run "Test DOSH_DOCKER_RUN_EXTRA_OPTS environment variable with echo short option -e"
if DOSH_DOCKER_RUN_EXTRA_OPTS="-e ECHO_SHORT_OPTION=true" dosh --dry-run 2>&1 | tee /dev/stderr | \
grep -q "docker run --rm --volume $PWD:$PWD:rw --user $UID:${GROUPS[0]} --env USER=$USER --env HOME=$HOME --interactive --workdir $PWD --env DOSHLVL=1 --entrypoint /bin/sh -e ECHO_SHORT_OPTION=true dosh-$USER-[0-9a-z]\{64\}"
Expand Down

0 comments on commit 1f1a365

Please sign in to comment.