Class: Slugforge::Build::Package

Inherits:
Slugforge::BuildCommand show all
Defined in:
lib/slugforge/build/package.rb

Instance Method Summary collapse

Methods inherited from Slugforge::BuildCommand

inherited

Methods inherited from Command

#initialize, start

Methods included from Helper

included

Constructor Details

This class inherits a constructor from Slugforge::Command

Instance Method Details

#callObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/slugforge/build/package.rb', line 5

def call
  existing = Dir.glob('*.slug')

  if options[:clean]
    existing.each do |path|
      logger.say_status :clean, path, :red
      File.delete(path)
    end
  end

  logger.say_status :execute, "fpm #{package_file_name}"
  execute(fpm_command)

  if options[:deploy]
    invoke Slugforge::Commands::Deploy, [:file, package_file_name, options[:deploy]], []
  end
end