|
|
|
@ -433,20 +433,26 @@ namespace eval punk::mix::commandset::project { |
|
|
|
#scan all files in template |
|
|
|
#scan all files in template |
|
|
|
# |
|
|
|
# |
|
|
|
#TODO - deck command to substitute templates? |
|
|
|
#TODO - deck command to substitute templates? |
|
|
|
set templatefiles [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout] |
|
|
|
set templateinfo_list [punk::mix::commandset::layout::lib::layout_scan_for_template_files $opt_layout] |
|
|
|
set stripprefix [file normalize $layout_path] |
|
|
|
set stripprefix [file normalize $layout_path] |
|
|
|
|
|
|
|
|
|
|
|
set tagmap [list [lib::template_tag project] $projectname] |
|
|
|
set tagmap [list [lib::template_tag project] $projectname] |
|
|
|
if {[llength $templatefiles]} { |
|
|
|
if {[llength $templateinfo_list]} { |
|
|
|
puts stdout "Filling template file placeholders with the following tag map:" |
|
|
|
puts stdout "Filling template file placeholders with the following tag map:" |
|
|
|
foreach {placeholder value} $tagmap { |
|
|
|
foreach {placeholder value} $tagmap { |
|
|
|
puts stdout " $placeholder -> $value" |
|
|
|
puts stdout " $placeholder -> $value" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
foreach templatefullpath $templatefiles { |
|
|
|
foreach templateinfo $templateinfo_list { |
|
|
|
|
|
|
|
lassign $templateinfo templatefullpath template_tagnames_found |
|
|
|
set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix] |
|
|
|
set templatetail [punk::repo::path_strip_alreadynormalized_prefixdepth $templatefullpath $stripprefix] |
|
|
|
|
|
|
|
|
|
|
|
set fpath [file join $projectdir $templatetail] |
|
|
|
set fpath [file join $projectdir $templatetail] |
|
|
|
|
|
|
|
foreach t $template_tagnames_found { |
|
|
|
|
|
|
|
if {"%$t%" ni [dict keys $tagmap]} { |
|
|
|
|
|
|
|
puts stderr "warning: No substitution available for tag: %$t% in $fpath" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if {[file exists $fpath]} { |
|
|
|
if {[file exists $fpath]} { |
|
|
|
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd |
|
|
|
set fd [open $fpath r]; fconfigure $fd -translation binary; set data [read $fd]; close $fd |
|
|
|
set data2 [string map $tagmap $data] |
|
|
|
set data2 [string map $tagmap $data] |
|
|
|
@ -458,7 +464,6 @@ namespace eval punk::mix::commandset::project { |
|
|
|
puts stderr "warning: Missing template file $fpath" |
|
|
|
puts stderr "warning: Missing template file $fpath" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#todo - tag substitutions in src/doc tree |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
::cd $projectdir |
|
|
|
::cd $projectdir |
|
|
|
|
|
|
|
|
|
|
|
|