Commit 7175553c authored by Samuel E. Giddins's avatar Samuel E. Giddins

[SourcesManager] Inform users about pre-release updates

Closes https://github.com/CocoaPods/CocoaPods/issues/2460.
parent 66d64c56
...@@ -199,8 +199,8 @@ module Pod ...@@ -199,8 +199,8 @@ module Pod
# #
def check_version_information(dir) def check_version_information(dir)
versions = version_information(dir) versions = version_information(dir)
unless repo_compatible?(dir)
min, max = versions['min'], versions['max'] min, max = versions['min'], versions['max']
unless repo_compatible?(dir)
version_msg = ( min == max) ? min : "#{min} - #{max}" version_msg = ( min == max) ? min : "#{min} - #{max}"
raise Informative, "The `#{dir.basename}` repo requires " \ raise Informative, "The `#{dir.basename}` repo requires " \
"CocoaPods #{version_msg} (currently using #{Pod::VERSION})\n".red + "CocoaPods #{version_msg} (currently using #{Pod::VERSION})\n".red +
...@@ -210,9 +210,11 @@ module Pod ...@@ -210,9 +210,11 @@ module Pod
needs_sudo = path_writable?(__FILE__) needs_sudo = path_writable?(__FILE__)
if config.new_version_message? && cocoapods_update?(versions) if config.new_version_message? && cocoapods_update?(versions)
install_message = needs_sudo ? 'sudo ' : ''
install_message << 'gem install cocoapods'
install_message << ' --pre' if Gem::Version.new(max).prerelease?
UI.puts "\nCocoaPods #{versions['last']} is available.\n" \ UI.puts "\nCocoaPods #{versions['last']} is available.\n" \
"To update use: #{needs_sudo ? 'sudo ' : ''}" \ "To update use: `#{install_message}`\n".green
'gem install cocoapods\n'.green
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment