Class: TerraspaceBundler::Mod::Fetcher::Local

Inherits:
Base
  • Object
show all
Defined in:
lib/terraspace_bundler/mod/fetcher/local.rb

Instance Attribute Summary

Attributes inherited from Base

#sha

Instance Method Summary collapse

Methods inherited from Base

#extract, #initialize, #switch_version

Constructor Details

This class inherits a constructor from TerraspaceBundler::Mod::Fetcher::Base

Instance Method Details

#runObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/terraspace_bundler/mod/fetcher/local.rb', line 3

def run
  stage_path = stage_path(rel_dest_dir)
  source = @mod.source
  src = source.sub(/^~/, ENV['HOME']) # allow ~/ notation
  FileUtils.rm_rf(stage_path)
  FileUtils.mkdir_p(File.dirname(stage_path))
  logger.debug "Local: cp -r #{src} #{stage_path}"
  # copy from stage area to vendor/modules/NAME
  # IE: cp -r /tmp/terraspace/bundler/stage/local/local1 vendor/modules/local1
  FileUtils.cp_r(src, stage_path)
end