Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fastlane][lanemanager] Fastlane command suggestion improvement when running using bundler #18515

Merged
merged 2 commits into from Apr 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions fastlane/lib/fastlane/lane_manager.rb
Expand Up @@ -107,12 +107,13 @@ def self.choose_lane(ff, platform)

puts(table)

fastlane_command_prefix = Helper.bundler? ? "bundle exec " : ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"#{fastlane_command_prefix}fastlane"

It's not a big deal but I prefer not to see a variable interpolated and a string literal combined, like above, as I might wonder if there is a whitespace between those two. What do you think about composing all the command name here so that my small concern is resolved? 🙂

Suggested change
fastlane_command_prefix = Helper.bundler? ? "bundle exec " : ""
fastlane_command = Helper.bundler? ? "bundle exec fastlane" : "fastlane"

i = UI.input("Which number would you like run?")

i = i.to_i - 1
if i >= 0 && available[i]
selection = available[i].last.pretty_name
UI.important("Running lane `#{selection}`. Next time you can do this by directly typing `fastlane #{selection}` 🚀.")
UI.important("Running lane `#{selection}`. Next time you can do this by directly typing `#{fastlane_command_prefix}fastlane #{selection}` 🚀.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take in mind to change this if taking @ainame's suggestions

platform = selection.split(' ')[0]
lane_name = selection.split(' ')[1]

Expand All @@ -123,7 +124,7 @@ def self.choose_lane(ff, platform)

return platform, lane_name # yeah
else
UI.user_error!("Run `fastlane` the next time you need to build, test or release your app 🚀")
UI.user_error!("Run `#{fastlane_command_prefix}fastlane` the next time you need to build, test or release your app 🚀")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this 🚀

end
end
end
Expand Down