Skip to content

Commit

Permalink
Showing the opt out message only once per machine
Browse files Browse the repository at this point in the history
  • Loading branch information
KrauseFx committed Apr 14, 2015
1 parent 4d7772e commit b599616
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/fastlane/action_collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ def did_raise_error(name)
def did_finish
Thread.new do
unless ENV["FASTLANE_OPT_OUT_USAGE"]
Helper.log.debug("Sending Crash/Success information. More information on: https://github.com/fastlane/enhancer")
Helper.log.debug(launches)
Helper.log.debug(@error) if @error
Helper.log.debug("This information is used to fix failing actions and improve actions that are often used.")
Helper.log.debug("You can disable this by adding `opt_out_usage` to your Fastfile")

unless did_show_message?
Helper.log.debug("Sending Crash/Success information. More information on: https://github.com/fastlane/enhancer")
Helper.log.debug(launches)
Helper.log.debug(@error) if @error
Helper.log.debug("This information is used to fix failing actions and improve integrations that are often used.")
Helper.log.debug("You can disable this by adding `opt_out_usage` to your Fastfile")
end

require 'excon'
url = HOST_URL + '/did_launch?'
Expand All @@ -37,5 +40,13 @@ def did_finish
def launches
@launches ||= {}
end

def did_show_message?
path = File.join(File.expand_path('~'), '.did_show_opt_info')

did_show = File.exists?path
File.write(path, '1')
did_show
end
end
end

0 comments on commit b599616

Please sign in to comment.