execute

in lib/github/markup/command_implementation.rb [54:65]


      def execute(command, target)
        command_with_timeout_prefix = prepend_command_timeout_prefix(command)
        stdout_str, stderr_str, status = Open3.capture3(*command_with_timeout_prefix, stdin_data: target)
        if status.success?
          sanitize(stdout_str, target.encoding)
        elsif status.termsig == Signal.list['KILL']
          raise TimeoutError.new("Command was killed, probably due to exceeding GITLAB_MARKUP_TIMEOUT limit of #{timeout_in_seconds} seconds")
        else
          raise CommandError.new(stderr_str.strip)
        end
      end