Method: Spaceship::Client#persistent_cookie_path

Defined in:
spaceship/lib/spaceship/client.rb

Returns preferred path for storing cookie for two step verification.



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'spaceship/lib/spaceship/client.rb', line 294

def persistent_cookie_path
  if ENV["SPACESHIP_COOKIE_PATH"]
    path = File.expand_path(File.join(ENV["SPACESHIP_COOKIE_PATH"], "spaceship", self.user, "cookie"))
  else
    [File.join(self.fastlane_user_dir, "spaceship"), "~/.spaceship", "/var/tmp/spaceship", "#{Dir.tmpdir}/spaceship"].each do |dir|
      dir_parts = File.split(dir)
      if directory_accessible?(File.expand_path(dir_parts.first))
        path = File.expand_path(File.join(dir, self.user, "cookie"))
        break
      end
    end
  end

  return path
end