Method: Inspec::Runner#write_lockfile

Defined in:
lib/inspec/runner.rb

#write_lockfile(profile) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
# File 'lib/inspec/runner.rb', line 103

def write_lockfile(profile)
  return false if !profile.writable?

  if profile.lockfile_exists?
    Inspec::Log.debug "Using existing lockfile #{profile.lockfile_path}"
  else
    Inspec::Log.debug "Creating lockfile: #{profile.lockfile_path}"
    lockfile = profile.generate_lockfile
    File.write(profile.lockfile_path, lockfile.to_yaml)
  end
end