39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/pluto/merge/formatter.rb', line 39
def make_for( site_key, manifest_name, output_path )
manifest_name = manifest_name.downcase.gsub('.txt', '' )
logger.debug "manifest=#{manifest_name}"
manifests = installed_template_manifests.select { |m| m[0] == manifest_name+'.txt' }
if manifests.empty?
puts "*** template pack '#{manifest_name}' not found; trying auto-install..."
Installer.new( opts ).install( manifest_name )
manifests = installed_template_manifests.select { |m| m[0] == manifest_name+'.txt' }
if manifests.empty?
puts "*** error: unknown template pack '#{manifest_name}'; use pluto ls to list installed template packs"
exit 2
end
end
manifestsrc = manifests[0][1]
pakpath = output_path
@site = Site.find_by_key( site_key )
if @site.nil?
puts "*** warn: no site with key '#{site_key}' found; using untitled site record"
@site = Site.new
@site.title = 'Planet Untitled'
end
Pakman::Templater.new.merge_pak( manifestsrc, pakpath, binding, site_key )
end
|