require 'travis/build/appliances/base'

module Travis
  module Build
    module Appliances
      class DisableSudo < Base
        MSG = "\nThis job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables. See http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.\n"
        CMD = 'sudo -n sh -c "sed -e \'s/^%.*//\' -i.bak /etc/sudoers && rm -f /etc/sudoers.d/travis && find / -perm -4000 -exec chmod a-s {} \; 2>/dev/null"'

        def apply
          sh.echo MSG, ansi: :yellow
          sh.cmd CMD
        end

        def apply?
          data.disable_sudo?
        end
      end
    end
  end
end

require 'travis/build/appliances/base'

module Travis
  module Build
    module Appliances
      class DisableSudo < Base
        MSG = "\nThis job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables.\nSee http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.\n"
        CMD = 'sudo -n sh -c "sed -e \'s/^%.*//\' -i.bak /etc/sudoers && rm -f /etc/sudoers.d/travis && find / -perm -4000 -exec chmod a-s {} \; 2>/dev/null"'

        def apply
          sh.echo MSG, ansi: :yellow
          sh.cmd CMD
        end

        def apply?
          data.disable_sudo?
        end
      end
    end
  end
end

Split disable-sudo message into two lines
Split disable-sudo message into two lines
