Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13038: fixed creating a new extension
... when using a custom template
  • Loading branch information
MichaelDaum committed Sep 26, 2014
1 parent f6eb44e commit a4ed8d2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions BuildContrib/create_new_extension.pl
@@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
# Script for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Author: Crawford Currie http://c-dot.co.uk
Expand Down Expand Up @@ -45,6 +45,10 @@
$def{MODULE} = $ARGV[0];
usage() unless $def{MODULE};

$def{MODULE} =~ /^.*?(Plugin|Contrib|Skin|AddOn)$/;
$def{TYPE} = $1;
usage() unless $def{TYPE};

# Determine the template module to use, either from an explicit parameter
# or by finding an appropriate Empty* template module
our $templateModule;
Expand All @@ -71,11 +75,11 @@
$def{TYPE} = $1;
usage() unless $def{TYPE};

$def{STUBS} = $def{TYPE} =~ /Plugin$/ ? 'Plugins' : 'Contrib';

$templateModule = "Empty$def{TYPE}";
}

$def{STUBS} = $def{TYPE} =~ /Plugin$/ ? 'Plugins' : 'Contrib';

unless ( $templateModule && -d $templateModule ) {
usage( error =>
"Template directory (./$templateModule) does not exist; it must be present in the current directory"
Expand Down

0 comments on commit a4ed8d2

Please sign in to comment.