Class: GDK::Command::Update

Inherits:
BaseCommand show all
Defined in:
lib/gdk/command/update.rb

Overview

Handles ‘gdk update` command execution

Instance Attribute Summary

Attributes inherited from BaseCommand

#stderr, #stdout

Instance Method Summary collapse

Methods inherited from BaseCommand

#config, #display_help_message, #help, #initialize, #print_help, #print_ready_message, #ready_messages, validate_config?

Constructor Details

This class inherits a constructor from GDK::Command::BaseCommand

Instance Method Details

#run(_args = []) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gdk/command/update.rb', line 7

def run(_args = [])
  update_result = update!

  unless update_result
    GDK::Output.error('Failed to update.')
    display_help_message

    return false
  end

  update_result = reconfigure! if config.gdk.auto_reconfigure?

  Announcements.new.render_all if update_result

  update_result
end