FastLanes Perform the sh action in the root folder of the Xcode project

Launch fastlane build_and_renamefor the following Fastfile,

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

leads to the following error ln: ./Build/MY-APP.ipa: No such file or directory.

Testing shows that the FastLane action shis performed in a directory ./fastlane. An example fastlane test_shfor the followingFastfile

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

results in where_am_i.txtcreated in the folder ./fastlane. Not in the folder where it fastlane was launched.

Obviously, I could change all the scenarios by including ../, but wondering, is there a way to make the action fastlanerun shin the root xCode project?

+4
source share
1 answer

, cd.. &&, .

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

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

+4

Source: https://habr.com/ru/post/1614470/


All Articles