Sha256: ada6ae3c9e4f2b58caf62d1e475a93137f70896c0dfabcfb11109e0304064ebb

Contents?: true

Size: 1.04 KB

Versions: 23

Compression:

Stored size: 1.04 KB

Contents

module Fastlane
  class FastlaneFolder
    FOLDER_NAME = 'fastlane'

    # Path to the fastlane folder containing the Fastfile and other configuration files
    def self.path
      value ||= "./#{FOLDER_NAME}/" if File.directory?("./#{FOLDER_NAME}/")
      value ||= "./.#{FOLDER_NAME}/" if File.directory?("./.#{FOLDER_NAME}/") # hidden folder
      value ||= "./" if File.basename(Dir.getwd) == FOLDER_NAME && File.exist?('Fastfile') # inside the folder
      value ||= "./" if File.basename(Dir.getwd) == ".#{FOLDER_NAME}" && File.exist?('Fastfile') # inside the folder and hidden

      value = nil if Helper.is_test? # this is required, as the tests would use the ./fastlane folder otherwise
      return value
    end

    # Does a fastlane configuration already exist?
    def self.setup?
      return false unless path
      File.exist?(File.join(path, "Fastfile"))
    end

    def self.create_folder!(path = nil)
      path = File.join(path || '.', FOLDER_NAME)
      FileUtils.mkdir_p(path)
      UI.success "Created new folder '#{path}'."
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
fastlane-1.85.0 lib/fastlane/fastlane_folder.rb
fastlane-1.84.0 lib/fastlane/fastlane_folder.rb
fastlane-1.83.0 lib/fastlane/fastlane_folder.rb
fastlane-1.82.0 lib/fastlane/fastlane_folder.rb
fastlane-1.81.0 lib/fastlane/fastlane_folder.rb
fastlane-1.80.0 lib/fastlane/fastlane_folder.rb
fastlane-1.70.0 lib/fastlane/fastlane_folder.rb
fastlane-1.69.0 lib/fastlane/fastlane_folder.rb
fastlane-1.68.0 lib/fastlane/fastlane_folder.rb
fastlane-1.67.0 lib/fastlane/fastlane_folder.rb
fastlane-1.66.0 lib/fastlane/fastlane_folder.rb
fastlane-1.65.0 lib/fastlane/fastlane_folder.rb
fastlane-1.64.0 lib/fastlane/fastlane_folder.rb
fastlane-1.63.1 lib/fastlane/fastlane_folder.rb
fastlane-1.63.0 lib/fastlane/fastlane_folder.rb
fastlane-1.62.0 lib/fastlane/fastlane_folder.rb
fastlane-1.61.0 lib/fastlane/fastlane_folder.rb
fastlane-1.60.0 lib/fastlane/fastlane_folder.rb
fastlane-1.59.0 lib/fastlane/fastlane_folder.rb
fastlane-1.58.0 lib/fastlane/fastlane_folder.rb