We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When hdiutil fails in a shellout! block we continue anyway (producing an empty build) as long as the last command in the block succeeds.
hdiutil
shellout!
6.0.30
Mac os Mojave 10.14.5
https://buildkite.com/chef/inspec-inspec-master-omnibus-release/builds/59#962a5eb3-a0f4-416c-9c10-362ffa9d9231/6-8385
These lines are failing. We probably need to put && on each command, but this pattern is used throughout the project.
&&
omnibus/lib/omnibus/compressors/dmg.rb
Line 258 in 035cc83
In this example shellout! is happy because the last command returned 0
2.5.3 :028 > shellout! <<-EOH.gsub(/^ {10}/, "") 2.5.3 :029"> false 2.5.3 :030"> true 2.5.3 :031"> EOH => <Mixlib::ShellOut#70164612236040: command: 'false true ' process_status: #<Process::Status: pid 13924 exit 0> stdout: '' stderr: '' child_pid: 13924 environment: {} timeout: 7200 user: group: working_dir: >
but in this example shellout raises because the last command failed:
2.5.3 :024 > shellout! <<-EOH.gsub(/^ {10}/, "") 2.5.3 :025"> true 2.5.3 :026"> false 2.5.3 :027"> EOH Traceback (most recent call last): 4: from /Users/btm/.rvm/rubies/ruby-2.5.3/bin/irb:11:in `<main>' 3: from (irb):24 2: from /Users/btm/.rvm/gems/ruby-2.5.3/gems/omnibus-6.0.30/lib/omnibus/util.rb:134:in `shellout!' 1: from /Users/btm/.rvm/gems/ruby-2.5.3/gems/omnibus-6.0.30/lib/omnibus/util.rb:139:in `rescue in shellout!' Omnibus::CommandFailed (The following shell command exited with status 1:) $ true false Output: (nothing) Error: (nothing)
This provides the expected behavior:
2.5.3 :032 > shellout! <<-EOH.gsub(/^ {10}/, "") 2.5.3 :033"> false && \\ 2.5.3 :034"> true 2.5.3 :035"> EOH Traceback (most recent call last): 4: from /Users/btm/.rvm/rubies/ruby-2.5.3/bin/irb:11:in `<main>' 3: from (irb):32 2: from /Users/btm/.rvm/gems/ruby-2.5.3/gems/omnibus-6.0.30/lib/omnibus/util.rb:134:in `shellout!' 1: from /Users/btm/.rvm/gems/ruby-2.5.3/gems/omnibus-6.0.30/lib/omnibus/util.rb:139:in `rescue in shellout!' Omnibus::CommandFailed (The following shell command exited with status 1:) $ false && \ true Output: (nothing) Error: (nothing)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When
hdiutil
fails in ashellout!
block we continue anyway (producing an empty build) as long as the last command in the block succeeds.Omnibus Version
6.0.30
Platform Version
Mac os Mojave 10.14.5
Replication Case
https://buildkite.com/chef/inspec-inspec-master-omnibus-release/builds/59#962a5eb3-a0f4-416c-9c10-362ffa9d9231/6-8385
These lines are failing. We probably need to put
&&
on each command, but this pattern is used throughout the project.omnibus/lib/omnibus/compressors/dmg.rb
Line 258 in 035cc83
In this example
shellout!
is happy because the last command returned 0but in this example shellout raises because the last command failed:
This provides the expected behavior:
The text was updated successfully, but these errors were encountered: