2016-06-17 43 views
4

我正在尝试使用Fastlane将部署自动化到TestFlight中。即使其中一个通道出错,我也希望它继续“出错”。如何使用Fastlane继续“出错”

例如,如果我运行下面的“doall”和“item1”错误,我希望它仍然运行“item2”和“item3”。

这是可能的,如果是这样,怎么办?谢谢!

lane :item1 do 
# Do some stuff 
end 

lane :item2 do 
# Do some stuff 
end 

lane :item3 do 
# Do some stuff 
end 

lane :doall do 
item1 # This causes an error 
item2 
item3 
end 

error do |lane, exception| 
# Send error notification 
end 

回答

10

您可以使用Ruby的错误处理要做到这一点

lane :item1 do 
# Do some stuff 
end 

lane :item2 do 
# Do some stuff 
end 

lane :item3 do 
# Do some stuff 
end 

lane :doall do 
begin 
    item1 # This causes an error 
rescue => ex 
    UI.error(ex) 
end 
begin 
    item2 
rescue => ex 
    UI.error(ex) 
end 
begin 
    item3 
rescue => ex 
    UI.error(ex) 
end 
end 

error do |lane, exception| 
# Send error notification 
end 

这不是超级美女,但这是做到这一点的最好办法,如果你想赶上错误每个车道。

+0

这样做,谢谢! – tcarter2005