#!/usr/bin/env perl
use v5.24;
use utf8;

use Yukki;

use Git::Repository v1.18;

my $repo_name   = shift;
my $remote_repo = shift;

die "usage: $0 repository-name [ remote-repository-url ]\n"
    unless $repo_name;

my $app = Yukki->new;

$app->model('Root')->init_repository(
    key                => $repo_name,
    origin             => $remote_repo,
    init_from_settings => 1,
);

# ABSTRACT: Initialize a git repository for use with Yukki
# PODNAME: yukki-git-init

__END__

=pod

=encoding UTF-8

=head1 NAME

yukki-git-init - Initialize a git repository for use with Yukki

=head1 VERSION

version 0.991_005

=head1 SYNOPSIS

  yukki-git-init repository
  yukki-git-init repository remote-repository

=head1 DESCRIPTION

This will initialize a git repository for use with Yukki. The script must be
called with at least one argument and accepts an optional second argument.

=over

=item repository

The repository is the name of the repository to initalized. It should be one of
the repository keys in the C<repositories> section of the F<yukki.conf>.

=item remote-repository

This is a git path to a repository to clone as a mirror for use with Yukki.

=back

=head1 ENVIRONMENT

Normally, this script tries to find F<etc/yukki.conf> from the current working
directory. If no configuraiton file is found, it checks C<YUKKI_CONFIG> for the
path to this file.

=head1 AUTHOR

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Qubling Software LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
