FastLanes.在Xcode项目根文件夹中运行sh动作

ajm*_*all 5 ios fastlane

fastlane build_and_rename在以下运行Fastfile,

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

导致以下错误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
Run Code Online (Sandbox Code Playgroud)

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

显然我可以更改所有脚本以包含../但想知道是否有办法在xCode的根项目中进行fastlane运行sh操作?

ajm*_*all 6

事实证明这很简单,只需添加cd.. &&到根目录的更改即可.

lane :test_sh do
    sh "cd .. && touch where_am_i.txt"
end
Run Code Online (Sandbox Code Playgroud)

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