Sha256: a729c48b3a5a3fb60b7025f9d95502b59a19802b7dfa0a9d167fe251471f6ffa

Contents?: true

Size: 778 Bytes

Versions: 5

Compression:

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

5 entries across 5 versions & 1 rubygems

Version Path
fastlane-0.12.4 lib/fastlane/fastlane_folder.rb
fastlane-0.12.3 lib/fastlane/fastlane_folder.rb
fastlane-0.12.2 lib/fastlane/fastlane_folder.rb
fastlane-0.12.1 lib/fastlane/fastlane_folder.rb
fastlane-0.12.0 lib/fastlane/fastlane_folder.rb