#!/usr/bin/env ruby # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true def mac? RUBY_PLATFORM.include?('darwin') end def path base_path = "#{ File.dirname(__FILE__) }/.." if mac? "#{ base_path }/service_executables/mac/contrast-service" else "#{ base_path }/service_executables/linux/contrast-service" end end executable_path = path if File.exist?(executable_path) Kernel.exec(executable_path) else puts "Service executable not found at: #{ executable_path }" end