ohai takes multiple parameters
Will not show any of the block if the 1st additional parameter is nil
This commit is contained in:
parent
a6577e5117
commit
69c076e741
@ -15,9 +15,15 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Homebrew. If not, see <http://www.gnu.org/licenses/>.
|
# along with Homebrew. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
def ohai title
|
# args are additional inputs to puts until a nil arg is encountered
|
||||||
|
def ohai title, *args
|
||||||
|
return if args.length > 0 and args[0].nil?
|
||||||
n=`tput cols`.strip.to_i-4
|
n=`tput cols`.strip.to_i-4
|
||||||
puts "\033[0;34m==>\033[0;0;1m #{title[0,n]}\033[0;0m"
|
puts "\033[0;34m==>\033[0;0;1m #{title[0,n]}\033[0;0m"
|
||||||
|
args.each do |arg|
|
||||||
|
return if arg.nil?
|
||||||
|
puts arg
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# shows a warning in delicious pink
|
# shows a warning in delicious pink
|
||||||
|
|||||||
6
bin/brew
6
bin/brew
@ -58,11 +58,7 @@ begin
|
|||||||
start_time=Time.now
|
start_time=Time.now
|
||||||
begin
|
begin
|
||||||
install f
|
install f
|
||||||
if f.caveats
|
ohai "Caveats", f.caveats, ''
|
||||||
ohai "Caveats"
|
|
||||||
puts f.caveats
|
|
||||||
puts
|
|
||||||
end
|
|
||||||
ohai 'Finishing up'
|
ohai 'Finishing up'
|
||||||
clean f
|
clean f
|
||||||
raise "Nothing was installed to #{f.prefix}" unless f.installed?
|
raise "Nothing was installed to #{f.prefix}" unless f.installed?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user