Sha256: 6bbb5532fbb2c3a01830c264d9da4784a68415f6513979abeeecef89d71f31d5

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

module Minke
  module Tasks
    class Fetch < Task

      def run args = nil
        puts "## Update dependencies"

        puts '### Install gems'
        rvm = "#{ENV['HOME']}/.rvm/scripts/rvm"
        rvm_root = '/usr/local/rvm/scripts/rvm'

        rvm_installed = File.exist?(rvm)
        rvm_root_installed = File.exist?(rvm_root)

        gemset = File.open('.ruby-gemset', 'rb') { |file| file.read }
        gemset = gemset.strip

        puts "Using gemset #{gemset}" 

        rvm_command = "source #{rvm} && rvm gemset use #{gemset} && " if rvm_installed
        rvm_command = "source #{rvm_root} && rvm gemset use #{gemset} && " if rvm_root_installed 

        @shell_helper.execute("/bin/bash -c '#{rvm_command}bundle install -j3 && bundle update'")

        puts '### Install generator dependencies'
        
        if @generator_config.build_settings.build_commands.fetch != nil
          run_with_block do
            @generator_config.build_settings.build_commands.fetch.each do |command|
              run_command_in_container command
            end
          end
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minke-1.11.8 lib/minke/tasks/fetch.rb