Skip to content

Commit

Permalink
Merge pull request #217 from Tumblr/fix-program-detection
Browse files Browse the repository at this point in the history
Fixup: program detection was incorrectly inverted
  • Loading branch information
Graham Christensen authored and GitHub Enterprise committed Jan 27, 2017
2 parents 63a4c59 + 86282bd commit 05c7a89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/jetpants/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,10 @@ def set_io_scheduler(name, device='sda')
end

def has_installed(program_name)
not (ssh_cmd "which #{program_name}" =~ /no #{program_name} in /).nil?
# The regex will match if the program is missing,
# thusly: no match means it is installed
# thusly: nil means it is present
(ssh_cmd("which #{program_name}") =~ /no #{program_name} in /).nil?
end

# Confirms that the specified binary is installed and on the shell path.
Expand Down

0 comments on commit 05c7a89

Please sign in to comment.