Skip to content
Snippets Groups Projects
Commit 5e266e1f authored by elijah's avatar elijah
Browse files

print friendly message if leap_platform is too old (closes #8423)

parent cd809a6b
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -63,8 +63,19 @@ module LeapCli
unless File.exist?(platform_definition)
Util.bail! "ERROR: The file `#{platform_file}` does not exist. Please check the value of `@platform_directory_path` in `Leapfile` or `~/.leaprc`."
end
begin
require platform_class
require platform_definition
rescue LoadError
Util.log "The leap_platform at #{platform_directory_path} is not compatible with this version of leap_cli"
Util.log "You can either:" do
Util.log "Upgrade leap_platform to version " + LeapCli::COMPATIBLE_PLATFORM_VERSION.first
Util.log "Or, downgrade leap_cli to version 1.8"
end
Util.bail!
rescue StandardError => exc
Util.bail! exc.to_s
end
begin
Leap::Platform.validate!(LeapCli::VERSION, LeapCli::COMPATIBLE_PLATFORM_VERSION, self)
rescue StandardError => exc
......
......@@ -45,7 +45,7 @@ module LeapCli
if message.any?
log(0, *message, &block)
else
log(0, :bailing, "out", &block)
log(0, :bailing, "out", :color => :red, :style => :bold, &block)
end
raise SystemExit.new(exit_status || 1)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment