lib/kapost/bootstrapper.rb in kapost-bootstrapper-0.5.1 vs lib/kapost/bootstrapper.rb in kapost-bootstrapper-0.5.2

- old
+ new

@@ -61,17 +61,16 @@ end def check(command, help = nil, version: nil) say(label(command, version)) do begin - block_given? ? yield : default_check(command, version) - true + result = block_given? ? yield : default_check(command, version) + @platform_result || result rescue CommandError => ex die help, exception: ex end - end - true + end or die(help) end def check_bundler check "bundler" do sh "gem install bundler --conservative &>/dev/null", verbose: false @@ -121,18 +120,18 @@ say(help) if help shell.exit 1 end def osx(&block) - run(&block) if os == :macosx + @platform_result = run(&block) if os == :macosx end def docker(&block) - run(&block) if os == :docker + @platform_result = run(&block) if os == :docker end def ubuntu(&block) - run(&block) if os == :ubuntu + @platform_result = run(&block) if os == :ubuntu end def run(&code) instance_eval(&code) or raise CommandError, code end