FastLanes。在Xcode项目的根文件夹

问题描述:

运行以下Fastfilefastlane build_and_rename运行SH行动,FastLanes。在Xcode项目的根文件夹

lane :build_and_rename do 
    sigh 
    gym(output_directory: "./Build/") 
    sh "mv ./Build/MY-APP.ipa ./Build/nicely_name.ipa" 
    end 

导致以下错误ln: ./Build/MY-APP.ipa: No such file or directory

测试显示FastLane的sh操作在./fastlane目录中运行。例如,fastlane test_sh以下Fastfile

lane :test_sh do 
    sh "touch where_am_i.txt" 
    end 

导致where_am_i.txt./fastlane文件夹中创建。不在fastlane运行的文件夹中。

很明显,我可以将所有脚本更改为包含../,但是想知道是否有办法使xcode的根项目中的fastlane运行sh动作?

事实证明,这很简单,只需添加cd.. &&即可切换到根目录。

lane :test_sh do 
    sh "cd .. && touch where_am_i.txt" 
end 

https://github.com/fastlane/fastlane/issues/990#issuecomment