Skip to content

Commit 05c7a89

Browse files
Graham ChristensenGitHub Enterprise
Graham Christensen
authored and
GitHub Enterprise
committed
Merge pull request #217 from Tumblr/fix-program-detection
Fixup: program detection was incorrectly inverted
2 parents 63a4c59 + 86282bd commit 05c7a89

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/jetpants/host.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,10 @@ def set_io_scheduler(name, device='sda')
823823
end
824824

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

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

0 commit comments

Comments
 (0)