如何从另一个lane调用存储在变量中的Fastlanelane

问题描述 投票:0回答:1

这可能是一个 Ruby 菜鸟问题。

我在同一个存储库中有多个 iOS 应用程序。因此,我有很多车道。我有一条车道,使用

tty
选择我想要运行的车道..

那么,假设用户选择

lane1
– 我该如何调用这条通道? :D

我可以使用反引号并使用

`fastlane %{userSelectedLane}`
。但是,这会启动一个新的 fastlane 运行程序并且不显示输出。

相反,我希望获得与从当前通道调用其他通道时相同的结果 - 即完整的快速通道输出。

这是我的设置:

lane :chooseLanes do |options|
    prompt = TTY::Prompt.new

    lanes = %w(lane1 lane2)

    lanesChosen = prompt.multi_select("Select lane?", lanes)

    for lane in lanesChosen do
        #How do I call this lane???
    end
end

lane :lane1 do |options|
end

lane :lane2 do |options|
end
ruby fastlane
1个回答
0
投票

好的,明白了:

lane :chooseLanes do |options|
    prompt = TTY::Prompt.new

    lanes = %w(lane1 lane2)

    lanesChosen = prompt.multi_select("Select lane?", lanes)

    for lane in lanesChosen do
        public_send(lane) #This does the trick!
    end
end

lane :lane1 do |options|
end

lane :lane2 do |options|
end
© www.soinside.com 2019 - 2024. All rights reserved.