Sha256: dc9c0cc4e7b6f5844ad2ca9a594ae7f0e2928863a19ffde3543fdfbe19cf320f

Contents?: true

Size: 646 Bytes

Versions: 24

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

require "English"

module ReactOnRails
  module GitUtils
    def self.uncommitted_changes?(message_handler)
      return false if ENV["COVERAGE"] == "true"

      status = `git status --porcelain`
      return false if $CHILD_STATUS.success? && status.empty?

      error = if $CHILD_STATUS.success?
                "You have uncommitted code. Please commit or stash your changes before continuing"
              else
                "You do not have Git installed. Please install Git, and commit your changes before continuing"
              end
      message_handler.add_error(error)
      true
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
react_on_rails-13.4.0 lib/react_on_rails/git_utils.rb
react_on_rails-13.3.5 lib/react_on_rails/git_utils.rb
react_on_rails-13.3.4 lib/react_on_rails/git_utils.rb
react_on_rails-13.3.3 lib/react_on_rails/git_utils.rb
react_on_rails-13.3.2 lib/react_on_rails/git_utils.rb
react_on_rails-13.3.1 lib/react_on_rails/git_utils.rb
react_on_rails-13.3.0 lib/react_on_rails/git_utils.rb
react_on_rails-13.2.0 lib/react_on_rails/git_utils.rb
react_on_rails-13.1.0 lib/react_on_rails/git_utils.rb
react_on_rails-13.0.2 lib/react_on_rails/git_utils.rb
react_on_rails-13.0.1 lib/react_on_rails/git_utils.rb
react_on_rails-13.0.0 lib/react_on_rails/git_utils.rb
react_on_rails-13.0.0.beta.0 lib/react_on_rails/git_utils.rb
react_on_rails-12.6.0 lib/react_on_rails/git_utils.rb
react_on_rails-12.5.2 lib/react_on_rails/git_utils.rb
react_on_rails-12.5.1 lib/react_on_rails/git_utils.rb
react_on_rails-12.5.0 lib/react_on_rails/git_utils.rb
react_on_rails-12.4.0 lib/react_on_rails/git_utils.rb
react_on_rails-12.4.0.rc.0 lib/react_on_rails/git_utils.rb
react_on_rails-12.3.0 lib/react_on_rails/git_utils.rb