Sha256: bb69725f6e73f5637f63167bae418b7874302c7a87a7b1e6ab721011b867517e

Contents?: true

Size: 1.46 KB

Versions: 35

Compression:

Stored size: 1.46 KB

Contents

module Fastlane
  module Actions
    class NotificationAction < Action
      def self.run(params)
        require 'terminal-notifier'

        if params[:subtitle]
          TerminalNotifier.notify(params[:message],
                                  title: params[:title],
                               subtitle: params[:subtitle])
        else
          # It should look nice without a subtitle too
          TerminalNotifier.notify(params[:message],
                                  title: params[:title])
        end
      end

      def self.description
        "Display a Mac OS X notification with custom message and title"
      end

      def self.author
        ["champo", "cbowns", "KrauseFx"]
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :title,
                                       description: "The title to display in the notification",
                                       default_value: 'fastlane'),
          FastlaneCore::ConfigItem.new(key: :subtitle,
                                       description: "A subtitle to display in the notification",
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :message,
                                       description: "The message to display in the notification",
                                       optional: false)
        ]
      end

      def self.is_supported?(platform)
        Helper.mac?
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
fastlane-1.63.0 lib/fastlane/actions/notification.rb
fastlane-1.62.0 lib/fastlane/actions/notification.rb
fastlane-1.61.0 lib/fastlane/actions/notification.rb
fastlane-1.60.0 lib/fastlane/actions/notification.rb
fastlane-1.59.0 lib/fastlane/actions/notification.rb
fastlane-1.58.0 lib/fastlane/actions/notification.rb
fastlane-1.57.0 lib/fastlane/actions/notification.rb
fastlane-1.56.0 lib/fastlane/actions/notification.rb
fastlane-1.55.0 lib/fastlane/actions/notification.rb
fastlane-1.54.0 lib/fastlane/actions/notification.rb
fastlane-1.53.0 lib/fastlane/actions/notification.rb
fastlane-1.52.0 lib/fastlane/actions/notification.rb
fastlane-1.51.0 lib/fastlane/actions/notification.rb
fastlane-1.50.0 lib/fastlane/actions/notification.rb
fastlane-1.49.0 lib/fastlane/actions/notification.rb
fastlane-1.48.0 lib/fastlane/actions/notification.rb
fastlane-1.47.0 lib/fastlane/actions/notification.rb
fastlane-1.46.1 lib/fastlane/actions/notification.rb
fastlane-1.46.0 lib/fastlane/actions/notification.rb
fastlane-1.45.0 lib/fastlane/actions/notification.rb