Browse Source

fix: ``compose`` command line arguments could be eaten

When rewriting arguments, any bash builtin's ``echo`` arguments
would be removed.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
cache-relation
Valentin Lab 5 years ago
parent
commit
8c7cf28bf6
  1. 10
      bin/compose
  2. 2
      bin/compose-core

10
bin/compose

@ -59,7 +59,7 @@ hash_get() {
next-0() { next-0() {
local ans IFS='' local ans IFS=''
read -r -d '' ans && read -r -d '' ans &&
echo -n "$ans"
printf "%s" "$ans"
} }
@ -1002,12 +1002,14 @@ run() {
[ -t 1 ] && docker_run_opts+=("-t") [ -t 1 ] && docker_run_opts+=("-t")
if [ -n "$DEBUG" ] || [ -n "$DRY_RUN" ]; then if [ -n "$DEBUG" ] || [ -n "$DRY_RUN" ]; then
debug "${WHITE}Launching:${NORMAL}"
echo "${WHITE}Launching:${NORMAL}"
echo "docker run --rm \\" echo "docker run --rm \\"
pretty_print "${docker_run_opts[@]}" | sed_compat 's/^/ /g;s/([^\])$/\1\\\n/g' pretty_print "${docker_run_opts[@]}" | sed_compat 's/^/ /g;s/([^\])$/\1\\\n/g'
if [ -z "$ENTER" ]; then if [ -z "$ENTER" ]; then
echo " ${COMPOSE_DOCKER_IMAGE} \\"
echo " " "$@"
printf "%s\n" " ${COMPOSE_DOCKER_IMAGE} \\"
printf " "
printf "%s " "$@"
printf "\n"
else else
echo " --entrypoint bash \\" echo " --entrypoint bash \\"
echo " ${COMPOSE_DOCKER_IMAGE}" echo " ${COMPOSE_DOCKER_IMAGE}"

2
bin/compose-core

@ -3769,7 +3769,7 @@ EOF
cached_wget() { cached_wget() {
local cache_file="$CACHEDIR/$FUNCNAME.cache.$(echo "$*" | md5_compat)" \
local cache_file="$CACHEDIR/$FUNCNAME.cache.$(p0 "$@" | md5_compat)" \
url="$1" url="$1"
if [ -e "$cache_file" ]; then if [ -e "$cache_file" ]; then
cat "$cache_file" cat "$cache_file"

Loading…
Cancel
Save