fastlane可以在某些车道上跳过`before_all`或`after_all`吗?

use*_*981 6 ios fastlane

我想知道是否有某些车道的方式来跳过before_allafter_all块的某些/指定的通道?

谢谢!

Chr*_* P. 19

一种方法:

before_all do |lane|
  if lane == :test
    puts "Do something for test"
  else
    puts "foo"
  end
end
Run Code Online (Sandbox Code Playgroud)

与您的评论有关的补充

lanes = [:test, :foo, :bar]
lanes.include?(:test) # => true
lanes.include?(:baz) # => false
Run Code Online (Sandbox Code Playgroud)

所以你可以做点什么

before_all do |lane|
  lanes_to_say_foo = [:test, :build, :other]
  if lanes_to_say_foo.include?(lane)
    puts "Foo"
  end
end
Run Code Online (Sandbox Code Playgroud)

  • 是的,你可以使用“if [:test, :beta].include?(lane)”。这些都是您可以使用的标准 Ruby :) (2认同)