-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Description
It would be great to have one more switch that is a middle ground between loud and --quiet: one that outputs successes to stdout but supresses the progress meters.
I know that there is a --quiet switch for docker-compose pull, but that prevents all output. When using docker-compose pull in a Vagrant provisioner, for example, the console is flooded with the progress meters being redrawn. Here is just a glipse, but it goes for pages and pages.
Using --quiet, however, results in no feedback whatsoever in the Vagrant console output. The following is a very imperfect workaround:
out=$(docker-compose pull 2>&1)
if [ $? -ne 0 ]; then
echo "$out" > /dev/stderr
else
echo "$out" | grep -E 'Pulled|Skipped'
fiThis checks the exit code of docker-compose for 0 and then dumps the output from the command as-is to stderr if there is a non-zero exit code or it filters the output for Pulled and Skipped before printing it to stdout if the exit code is zero. There are other keywords that people may want. These are just for my own specific, narrow use case.
Using this workaround, the Vagrant console output is green and clean.

