Method: Inspec::Runner#write_lockfile

Defined in:
lib/inspec/runner.rb

#write_lockfile(profile) ⇒ Object



119
120
121
122
123
124
125
126
127
128
129
# File 'lib/inspec/runner.rb', line 119

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