class Minipack::Commands::PkgInstall

Constants

PKG_INSTALL_CACHE_KEY

Public Class Methods

new(logger: nil) click to toggle source
# File lib/minipack/commands/pkg_install.rb, line 8
def initialize(logger: nil)
  @logger = logger
end

Public Instance Methods

call() click to toggle source
# File lib/minipack/commands/pkg_install.rb, line 12
def call
  Minipack.configuration.leaves.each do |c|
    # Note: someone wants pre_pkg_install hook?
    pkg_install(c)
    # Note: someone wants post_pkg_install hook?
   end
  true
end

Private Instance Methods

pkg_install(c) click to toggle source
# File lib/minipack/commands/pkg_install.rb, line 23
def pkg_install(c)
  pkg_install_cache_key = PKG_INSTALL_CACHE_KEY.map { |f| File.expand_path(f, c.resolved_base_path) }
  watcher = FileChangeWatcher.new(pkg_install_cache_key, File.join(c.cache_path, "last-installation-digest-#{c.id}-#{::Rails.env}"))
  CommandRunner.new(
    {},
    c.pkg_install_command,
    chdir: c.resolved_base_path,
    logger: @logger,
    watcher: watcher,
  ).run!
end