Sha256: 436032835e03702561440edc381509c195bf96004ea31639afe25d15cd42c6e3

Contents?: true

Size: 1.11 KB

Versions: 91

Compression:

Stored size: 1.11 KB

Contents

module Fastlane
  module Actions
    module SharedValues
      HG_REPO_WAS_CLEAN_ON_START = :HG_REPO_WAS_CLEAN_ON_START
    end
    # Raises an exception and stop the lane execution if the repo is not in a clean state
    class HgEnsureCleanStatusAction < Action
      def self.run(params)
        repo_clean = `hg status`.empty?

        if repo_clean
          Helper.log.info 'Mercurial status is clean, all good! 😎'.green
          Actions.lane_context[SharedValues::HG_REPO_WAS_CLEAN_ON_START] = true
        else
          raise 'Mercurial repository is dirty! Please ensure the repo is in a clean state by commiting/stashing/discarding all changes first.'.red
        end
      end

      def self.description
        "Raises an exception if there are uncommited hg changes"
      end

      def self.output
        [
          ['HG_REPO_WAS_CLEAN_ON_START', 'Stores the fact that the hg repo was clean at some point']
        ]
      end

      def self.author
        # credits to lmirosevic for original git version
        "sjrmanning"
      end

      def self.is_supported?(platform)
        true
      end
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
fastlane-1.47.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.46.1 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.46.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.45.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.44.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.43.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.42.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.41.1 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.41.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.40.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.39.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.38.1 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.38.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.37.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.36.4 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.36.3 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.36.2 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.36.1 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.36.0 lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-1.35.0 lib/fastlane/actions/hg_ensure_clean_status.rb