From a721e736c595e276d215fd35a2e056010765d081 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Thu, 23 Sep 2010 08:54:43 +0100 Subject: [PATCH] If curl fails propagate its exit status through the pipe --- install_homebrew.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_homebrew.rb b/install_homebrew.rb index b0740572b0..28a8fa8128 100644 --- a/install_homebrew.rb +++ b/install_homebrew.rb @@ -125,7 +125,8 @@ end Dir.chdir "/usr/local" do ohai "Downloading and Installing Homebrew..." # -m to stop tar erroring out if it can't modify the mtime for root owned directories - system "/usr/bin/curl -sSfL http://github.com/mxcl/homebrew/tarball/master | /usr/bin/tar xz -m --strip 1" + # pipefail to cause the exit status from curl to propogate if it fails + system "/bin/bash -o pipefail -c '/usr/bin/curl -sSfL http://github.com/mxcl/homebrew/tarball/master | /usr/bin/tar xz -m --strip 1'" end ohai "Installation successful!"