13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/appmap/command/agent_setup/init.rb', line 13
def perform
if File.exist?(config_file)
puts AppMap::Util.color(%(The AppMap config file #{config_file} already exists.), :magenta)
return
end
ensure_directory_exists
config = {
'name' => Service::Guesser.guess_name,
'packages' => Service::Guesser.guess_paths.map { |path| { 'path' => path } }
}
content = YAML.dump(config).gsub("---\n", '')
File.write(config_file, content)
puts AppMap::Util.color(
%(The following AppMap config file #{config_file} has been created:),
:green
)
puts content
end
|