Method: Fastlane::Setup#append_lane

Defined in:
fastlane/lib/fastlane/setup/setup.rb

#append_lane(lane) ⇒ Object

Append a lane to the current Fastfile template we’re generating



168
169
170
171
172
173
174
175
176
177
178
179
# File 'fastlane/lib/fastlane/setup/setup.rb', line 168

def append_lane(lane)
  lane.compact! # remove nil values

  new_lines = "\n\n"
  if self.is_swift_fastfile
    new_lines = "" unless self.fastfile_content.include?("lane() {") # the first lane we don't want new lines
    self.fastfile_content.gsub!("[[LANES]]", "#{new_lines}\t#{lane.join("\n\t")}[[LANES]]")
  else
    new_lines = "" unless self.fastfile_content.include?("lane :") # the first lane we don't want new lines
    self.fastfile_content.gsub!("[[LANES]]", "#{new_lines}  #{lane.join("\n  ")}[[LANES]]")
  end
end