Sha256: 8ad34f4e2b18a3bc1919c51777c601be4d294f9144beef5a93528eaf413b2cd9

Contents?: true

Size: 934 Bytes

Versions: 3

Compression:

Stored size: 934 Bytes

Contents

require_relative 'module'

module Screengrab
  class Setup
    # This method will take care of creating a screengrabfile and other necessary files
    def self.create(path, is_swift_fastfile: false)
      if is_swift_fastfile
        template_location = "#{Screengrab::ROOT}/lib/assets/ScreengrabfileTemplate.swift"
        screengrabfile_path = File.join(path, 'Screengrabfile.swift')
      else
        template_location = "#{Screengrab::ROOT}/lib/assets/ScreengrabfileTemplate"
        screengrabfile_path = File.join(path, 'Screengrabfile')
      end

      if File.exist?(screengrabfile_path)
        UI.user_error!("Screengrabfile already exists at path '#{screengrabfile_path}'. Run 'screengrab' to use screengrab.")
      end

      File.write(screengrabfile_path, File.read(template_location))

      UI.success("Successfully created new Screengrabfile at '#{screengrabfile_path}'")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastlane_hotfix-2.165.1 screengrab/lib/screengrab/setup.rb
fastlane_hotfix-2.165.0 screengrab/lib/screengrab/setup.rb
fastlane_hotfix-2.187.0 screengrab/lib/screengrab/setup.rb