Method: Fetchers::Git#fetch
- Defined in:
- lib/fetchers/git.rb
#fetch(dir) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/fetchers/git.rb', line 46 def fetch(dir) @repo_directory = dir FileUtils.mkdir_p(dir) unless Dir.exist?(dir) if cloned? checkout else Dir.mktmpdir do |tmpdir| checkout(tmpdir) Inspec::Log.debug("Checkout of #{resolved_ref} successful. Moving checkout to #{dir}") FileUtils.cp_r(tmpdir + "/.", @repo_directory) end end @repo_directory end |