diff options
Diffstat (limited to 'pinyadmin/sbin')
-rwxr-xr-x | pinyadmin/sbin/newrepo | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/pinyadmin/sbin/newrepo b/pinyadmin/sbin/newrepo index 0a6cdf0..a13a0dc 100755 --- a/pinyadmin/sbin/newrepo +++ b/pinyadmin/sbin/newrepo @@ -7,12 +7,12 @@ use Moose::Util::TypeConstraints qw( find_type_constraint ); use Piny; -my ( $batch, $name ); +my ( $batch, $name, $remote ); if ( $ARGV[0] eq "--batch" ) { - ( $batch, $name ) = @ARGV; + ( $batch, $name, $remote ) = @ARGV; } else { - ( $name ) = @ARGV; + ( $name, $remote ) = @ARGV; }; if ( not defined $name ) { @@ -59,9 +59,20 @@ A new piny repo ``$name'' has been created. Description: $description END + +if( defined( $remote ) ) { + print( MAIL "\nRemote: $remote\n" ); +}; + close( MAIL ); -my $repo = Piny::Repo->create( $name, $description ); +my $repo; + +if( defined( $remote ) ) { + $repo = Piny::Repo->create( $name, $description, $remote ); +} else { + $repo = Piny::Repo->create( $name, $description ); +}; print "Repo URL: " . $repo->ikiwiki_url . "\n"; print "Repo URL: " . $repo->cgit_url . "\n"; |