summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorGervase Markham <gerv@gerv.net>2015-05-05 15:14:47 +0200
committerGervase Markham <gerv@gerv.net>2015-05-05 15:14:47 +0200
commit2309b684454eaef96d954048411565210eddcf3a (patch)
tree62590bb78cd80de5a5d0b25d2a25c223e3a10bf6 /extensions
parent88628a5ca0c8af56440d08b09bb088fc337b3c56 (diff)
downloadbugzilla-2309b684454eaef96d954048411565210eddcf3a.tar.gz
bugzilla-2309b684454eaef96d954048411565210eddcf3a.tar.xz
Bug 1159318 - make docs/makedocs.pl and extensions/create.pl agree on the name of docs directories. r=LpSolit, a=glob
Diffstat (limited to 'extensions')
-rwxr-xr-xextensions/create.pl17
1 files changed, 11 insertions, 6 deletions
diff --git a/extensions/create.pl b/extensions/create.pl
index d4256694b..7c8693e28 100755
--- a/extensions/create.pl
+++ b/extensions/create.pl
@@ -10,7 +10,10 @@ use 5.10.1;
use strict;
use warnings;
-use lib qw(. lib);
+use File::Basename;
+BEGIN { chdir dirname($0); }
+
+use lib qw(.. ../lib);
use Bugzilla;
use Bugzilla::Constants;
@@ -32,7 +35,7 @@ mkpath($extension_dir)
|| die "$extension_dir already exists or cannot be created.\n";
my $lcname = lc($name);
-foreach my $path (qw(lib doc web template/en/default/hook),
+foreach my $path (qw(lib docs/en/rst web template/en/default/hook),
"template/en/default/$lcname")
{
mkpath("$extension_dir/$path") || die "$extension_dir/$path: $!";
@@ -47,7 +50,8 @@ my %create_files = (
'web-readme.txt.tmpl' => 'web/README',
'hook-readme.txt.tmpl' => 'template/en/default/hook/README',
'name-readme.txt.tmpl' => "template/en/default/$lcname/README",
- 'name.rst.tmpl' => "doc/$lcname.rst",
+ 'index-admin.rst.tmpl' => "docs/en/rst/index-admin.rst",
+ 'index-user.rst.tmpl' => "docs/en/rst/index-user.rst",
);
foreach my $template_file (keys %create_files) {
@@ -55,9 +59,10 @@ foreach my $template_file (keys %create_files) {
my $output;
$template->process("extensions/$template_file", $vars, \$output)
or ThrowTemplateError($template->error());
- open(my $fh, '>', "$extension_dir/$target");
- print $fh $output;
- close($fh);
+ open(my $fh, '>', "$extension_dir/$target")
+ or die "extension_dir/$target: $!";
+ print $fh $output;
+ close($fh);
}
say get_text('extension_created', $vars);