Sha256: eecd0eeca7e5cd2d7c48f9b7d0264e04444bd5e1e0e65be6505954185a5c42e6

Contents?: true

Size: 1.05 KB

Versions: 56

Compression:

Stored size: 1.05 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

56 entries across 56 versions & 1 rubygems

Version Path
fastlane-1.54.0 lib/fastlane/fastlane_folder.rb
fastlane-1.53.0 lib/fastlane/fastlane_folder.rb
fastlane-1.52.0 lib/fastlane/fastlane_folder.rb
fastlane-1.51.0 lib/fastlane/fastlane_folder.rb
fastlane-1.50.0 lib/fastlane/fastlane_folder.rb
fastlane-1.49.0 lib/fastlane/fastlane_folder.rb
fastlane-1.48.0 lib/fastlane/fastlane_folder.rb
fastlane-1.47.0 lib/fastlane/fastlane_folder.rb
fastlane-1.46.1 lib/fastlane/fastlane_folder.rb
fastlane-1.46.0 lib/fastlane/fastlane_folder.rb
fastlane-1.45.0 lib/fastlane/fastlane_folder.rb
fastlane-1.44.0 lib/fastlane/fastlane_folder.rb
fastlane-1.43.0 lib/fastlane/fastlane_folder.rb
fastlane-1.42.0 lib/fastlane/fastlane_folder.rb
fastlane-1.41.1 lib/fastlane/fastlane_folder.rb
fastlane-1.41.0 lib/fastlane/fastlane_folder.rb
fastlane-1.40.0 lib/fastlane/fastlane_folder.rb
fastlane-1.39.0 lib/fastlane/fastlane_folder.rb
fastlane-1.38.1 lib/fastlane/fastlane_folder.rb
fastlane-1.38.0 lib/fastlane/fastlane_folder.rb