INNER CODE UNIT · Ruby
docker_compose_legacy_binary_exists
EugenMayer/docker-sync · lib/docker-sync/docker_compose_session.rb:29
def docker_compose_legacy_binary_exists?
system('which docker-compose > /dev/null 2>&1')
end
def run!(*args)
# file_args and args should be Array of String
file_args = @files.map { |file| "--file=#{file}" }
if docker_compose_legacy_binary_exists?
command = 'docker-compose'
command_args = file_args + args
else
command = 'docker'
command_args = ['compose'] + file_args + args
end
@last_command = Command.run(command, *command_args, dir: @dir).join