Class: Afterlife::Cli

Inherits:
Thor
  • Object
show all
Includes:
BaseCli
Defined in:
lib/afterlife/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseCli

#fatal!, #log_error, #log_info, #log_interrupted, #log_success, #sure?

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/afterlife/cli.rb', line 8

def self.exit_on_failure?
  true
end

Instance Method Details

#deploy(stage) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/afterlife/cli.rb', line 39

def deploy(stage)
  invoke Deploy::Cli, :call, [stage], options
rescue Error
  fatal!(e.message)
rescue Interrupt
  log_interrupted
end

#initObject



17
18
19
20
21
22
23
# File 'lib/afterlife/cli.rb', line 17

def init
  FileUtils.mkdir_p(Afterlife.local_path.join('logs'))
  FileUtils.mkdir_p(Afterlife.local_path.join('pids'))
  FileUtils.mkdir_p(Afterlife::Cdn.local_path)
  FileUtils.touch(Afterlife::Config.file)
  log_success 'afterlife is ready!'
end

#versionObject



52
53
54
# File 'lib/afterlife/cli.rb', line 52

def version
  say Afterlife::VERSION
end