Sha256: d57462fb6942753865a19bf74478db3495660f3f6f9eb53c8a73d5f3156605fb

Contents?: true

Size: 947 Bytes

Versions: 11

Compression:

Stored size: 947 Bytes

Contents

module Fastlane
  class FastlaneFolder
    FOLDER_NAME = 'fastlane'

    # Path to the fastlane folder containing the Fastfile and other configuration files
    def self.path
      return "./#{FOLDER_NAME}/" if File.directory?("./#{FOLDER_NAME}/")
      return "./.#{FOLDER_NAME}/" if File.directory?("./.#{FOLDER_NAME}/") # hidden folder
      return './' if File.basename(Dir.getwd) == FOLDER_NAME && File.exist?('Fastfile') # inside the folder
      return './' if File.basename(Dir.getwd) == ".#{FOLDER_NAME}" && File.exist?('Fastfile') # inside the folder and hidden
      nil
    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

11 entries across 11 versions & 1 rubygems

Version Path
fastlane-1.8.0 lib/fastlane/fastlane_folder.rb
fastlane-1.7.3 lib/fastlane/fastlane_folder.rb
fastlane-1.7.2 lib/fastlane/fastlane_folder.rb
fastlane-1.7.1 lib/fastlane/fastlane_folder.rb
fastlane-1.7.0 lib/fastlane/fastlane_folder.rb
fastlane-1.6.0 lib/fastlane/fastlane_folder.rb
fastlane-1.5.0 lib/fastlane/fastlane_folder.rb
fastlane-1.4.0 lib/fastlane/fastlane_folder.rb
fastlane-1.3.2 lib/fastlane/fastlane_folder.rb
fastlane-1.3.1 lib/fastlane/fastlane_folder.rb
fastlane-1.3.0 lib/fastlane/fastlane_folder.rb