2

I'm running a shell script via capistrano to install rvm and ruby. When running

rvm install ruby-${RUBY_VERSION} 2>&1 > ../log/ruby_install.log

in my script, all output seems to be going to the log file, except for the scrollbar output. that output is being sent back to capistrano and it's flooding the output, and looks horrible.

Is there any way I can hide the progress during the command?

I tried running

alias curl="curl --silent"

before the command, but it doesn't work at all, so I guess the install is happening via some other means.

josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157

2 Answers2

1

Try:

gem install rvm-capistrano -v ">=1.3.0.rc11"

It contains code to make curl silent

mpapis
  • 52,729
  • 14
  • 121
  • 158
0

The answer from @mpapis lead me to the following solution:

# Rename .curlrc if present
if [[ -f $HOME/.curlrc ]]; then
    echo "Backing up .curlrc"
    mv $HOME/.curlrc $HOME/.curlrc~
fi

# Create a temporary .curlrc configuration file, this prevents curl from flooding the Capistrano output
{
    echo "insecure"
    echo "silent" # Hide verbose output, it floods the capistrano output
    echo "show-error"
} > $HOME/.curlrc

I added the above snippet to my bash script, and at the end, I just restored .curlrc to it's previous state:

rm $HOME/.curlrc
if [[ -f $HOME/.curlrc~ ]]; then
    mv $HOME/.curlrc~ $HOME/.curlrc
fi

This is modified from rvm-capistrano, check it out on the original Github Repository.

josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157