3

I have been trying to create a lane for creating a new branch with my fastfile. As far as I have tried in order to run git commands, I have to use the "sh" command in fast file like this: sh("git", "checkout", "-b","ANewBranch")

Is there a plugin to remove this dependency of using the sh and double quotes?

Also I have been trying to run the "git_branch" action form my fast file but it does not work. Other actions like "increment_build_number" work as expected. Here is the fastfile:

lane :createBranch do | options |
    if options[:branchName]
        sh("git", "checkout", "-b", options[:branchName])
        git_branch
    else
        UI.user_error!("Send the branch name as: <fastlane createBranch branchName:NewBranchName>")
    end
end
nr5
  • 4,228
  • 8
  • 42
  • 82

1 Answers1

1

I know this is an old question. But if someone is wondering how to do this, checkout this Fastlane plugin.

Samitha Nanayakkara
  • 2,529
  • 2
  • 10
  • 23