lib/mikeplayer/play_thread.rb in mikeplayer-1.1.0 vs lib/mikeplayer/play_thread.rb in mikeplayer-1.1.1

- old
+ new

@@ -86,14 +86,20 @@ false end def self.cmd_exist?(cmd) - if (true != system('command')) - raise "Missing 'command' command, which is used to test compatibility." + if @test_cmd.nil? + if system('command') + @test_cmd = 'command -v' + elsif system('bash -c "command"') + @test_cmd = 'bash -c "command -v"' + else + raise "Missing 'command' command, which is used to test compatibility." + end end - if (true != system("command -v #{cmd} >/dev/null 2>&1")) + if (true != system("#{@test_cmd} #{cmd} >/dev/null 2>&1")) return false end return true end