-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[action][update_info_plist] improve the plist file-path option validation check #20356
[action][update_info_plist] improve the plist file-path option validation check #20356
Conversation
@@ -80,7 +80,7 @@ def self.available_options | |||
description: "Path to info plist", | |||
optional: true, | |||
verify_block: proc do |value| | |||
UI.user_error!("Invalid plist file") unless value[-6..-1].casecmp(".plist").zero? | |||
UI.user_error!("Invalid plist file") unless value.end_with?(".plist") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you want something like value.downcase.end_with?(".plist")
to keep the casecmp
? or it this not necessary anymore?
Alternatively value =~ /\.plist^/i
is an option I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review. applied suggestion. 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! This feels much better 😊
* master: [pilot] added the Pilot::TesterExporter class unit tests (#20394) Add device Google Pixel 5 (#20389) [action][update_info_plist] improve the plist file-path option validation check (#20356) Specify s3 object prefix (#20344) [snapshot] Add missing iPod touch to Generated Snapshot Reports (#20337) [Ruby] Ruby 2.6 is now the minimum (dropping Ruby 2.5) (#20413)
Hey @crazymanish 👋 Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉 Please let us know if this change requires an immediate release by adding a comment here 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.207.0 🚀 |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
[-6..-1]
which is a kind of magical number range for non-ruby developerDescription
value.end_with?(".plist")
which is more readable, i hope 😍Testing Steps