Sha256: 4114601191f8622eb0ceece0eeaec2ec753ad2c29d4eed468b74ae361ffb32de

Contents?: true

Size: 1.06 KB

Versions: 15

Compression:

Stored size: 1.06 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)
      Helper.log.info "Created new folder '#{path}'.".green
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fastlane-1.20.0 lib/fastlane/fastlane_folder.rb
fastlane-1.19.0 lib/fastlane/fastlane_folder.rb
fastlane-1.18.0 lib/fastlane/fastlane_folder.rb
fastlane-1.17.1 lib/fastlane/fastlane_folder.rb
fastlane-1.17.0 lib/fastlane/fastlane_folder.rb
fastlane-1.16.0 lib/fastlane/fastlane_folder.rb
fastlane-1.15.0 lib/fastlane/fastlane_folder.rb
fastlane-1.14.1 lib/fastlane/fastlane_folder.rb
fastlane-1.14.0 lib/fastlane/fastlane_folder.rb
fastlane-1.13.1 lib/fastlane/fastlane_folder.rb
fastlane-1.13.0 lib/fastlane/fastlane_folder.rb
fastlane-1.12.0 lib/fastlane/fastlane_folder.rb
fastlane-1.11.0 lib/fastlane/fastlane_folder.rb
fastlane-1.10.0 lib/fastlane/fastlane_folder.rb
fastlane-1.9.0 lib/fastlane/fastlane_folder.rb