Class: Middleman::Cli::Deploy

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/middleman-deploy/commands.rb

Overview

This class provides a “deploy” command for the middleman CLI.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Tell Thor to exit with a nonzero exit code on failure

Returns:

  • (Boolean)


18
19
20
# File 'lib/middleman-deploy/commands.rb', line 18

def self.exit_on_failure?
  true
end

Instance Method Details

#deployObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/middleman-deploy/commands.rb', line 28

def deploy
  if options.has_key? "build_before"
    build_before = options.build_before
  else
    build_before = self.deploy_options.build_before
  end
  if build_before
    # http://forum.middlemanapp.com/t/problem-with-the-build-task-in-an-extension
    run("middleman build") || exit(1)
  end
  send("deploy_#{self.deploy_options.method}")
end