diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-06-02 12:35:57 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-06-02 12:35:57 +0000 |
commit | 87e50bde851487e13c183a5d017bf1fe9225e321 (patch) | |
tree | 30091d41ec2f65d336883a0c854b3b8d739d0989 /lib/make | |
parent | 86b042f2c425e3434ef2e6a42473dfdb294b23a6 (diff) |
From Ian Kelley ...
Prompt for Author and email address for the README and docs
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2885 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make')
-rwxr-xr-x | lib/make/new_thorn.pl | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/lib/make/new_thorn.pl b/lib/make/new_thorn.pl index f749d195..5739da23 100755 --- a/lib/make/new_thorn.pl +++ b/lib/make/new_thorn.pl @@ -39,6 +39,14 @@ if(!$package) } } +do { + push @author_names, &prompt("Author Name"); + push @author_emails, &prompt("Email Address"); + $another_author = &prompt("Add another author? Y/N"); +} while ($another_author =~ /^y/i); + + + chdir $package_dir; if(! -d "$package") @@ -90,7 +98,14 @@ close OUT; open(OUT, ">README") || die "Cannot create README"; print OUT "Cactus Code Thorn $thorn_name\n"; -print OUT "Authors : ...\n"; +print OUT "Authors : "; +for ($i = 0; $i < (@author_names); $i++) { + if ($i ne 0) { + print OUT "\n "; + } + print OUT "$author_names[$i] <$author_emails[$i]>"; +} +print OUT "\n"; print OUT "CVS info : \$Header\$\n"; print OUT "--------------------------------------------------------------------------\n"; print OUT "\n"; @@ -116,10 +131,34 @@ print OUT "\n"; close OUT; my $documentation_outputfile = "$cctk_home/$package_dir/$package/$thorn_name/doc/documentation.tex"; +open(IN, "<$documentation_inputfile") || die "Cannot open $documentation_inputfile"; +open(OUT, ">$documentation_outputfile") || die "Cannot create $documentation_outputfile"; + +while (<IN>) { + if (/^\\author\{\s*?\}/) { + print OUT "\\author\{"; + for ($i = 0; $i < (@author_names); $i++) { + if ($i ne 0) { + print OUT " \\\\ "; + } + print OUT "$author_names[$i] \$<\$$author_emails[$i]\$>\$"; + } + print OUT "\}\n"; + } elsif (/^\\date\{\s*?\}/) { + my $todays_date = `date "+%B %d %Y"`; + chomp ($todays_date); + if ($todays_date =~ /^\w+\s+\d+\s+\d+$/) { + print OUT "\\date\{$todays_date\}\n"; + } else { + print OUT $_; + } + } else { + print OUT $_; + } +} +#system("cp $documentation_inputfile $documentation_outputfile"); -system("cp $documentation_inputfile $documentation_outputfile"); - -print "All done. Please remember to fill out the README and doc/documenation.tex files.\n"; +print "All done. \nPlease remember to fill out the README and doc/documentation.tex files.\n"; exit; |