Sha256: d78f46f08490f8d248dfdd166d2a808655ac08f37aedb75367bd7b58463627c3

Contents?: true

Size: 784 Bytes

Versions: 10

Compression:

Stored size: 784 Bytes

Contents

module Fastlane
  class FastlaneFolder
    FOLDER_NAME = 'fastlane'

    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

    def self.setup?
      return false unless path
      File.exist?(path)
    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

10 entries across 10 versions & 1 rubygems

Version Path
fastlane-1.2.3 lib/fastlane/fastlane_folder.rb
fastlane-1.2.2 lib/fastlane/fastlane_folder.rb
fastlane-1.2.1 lib/fastlane/fastlane_folder.rb
fastlane-1.2.0 lib/fastlane/fastlane_folder.rb
fastlane-1.1.0 lib/fastlane/fastlane_folder.rb
fastlane-1.0.2 lib/fastlane/fastlane_folder.rb
fastlane-1.0.1 lib/fastlane/fastlane_folder.rb
fastlane-1.0.0 lib/fastlane/fastlane_folder.rb
fastlane-0.13.0 lib/fastlane/fastlane_folder.rb
fastlane-0.12.5 lib/fastlane/fastlane_folder.rb