NAME

App::GitHubUtils - Utilities related to GitHub

VERSION

This document describes version 0.007 of App::GitHubUtils (from Perl distribution App-GitHubUtils), released on 2021-05-10.

DESCRIPTION

This distribution provides the following command-line utilities related to GitHub:

FUNCTIONS

create_this_repo_on_github

Usage:

create_this_repo_on_github(%args) -> [status, msg, payload, meta]

Create this repo on github.

This is a convenient no-argument-needed command to create GitHub repository of the current ("this") repo. Will use github-cmd from App::github::cmd to create the repository. To find out the repo name to be created, will first check .git/config if it exists. Otherwise, will just use the name of the current directory.

This function is not exported.

Arguments ('*' denotes required arguments):

  • github_cmd_config_profile => str

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

git_clone_from_github

Usage:

git_clone_from_github(%args) -> [status, msg, payload, meta]

git clone, with some conveniences.

Instead of having to type:

% git clone git@github.com:USER/PREFIX-NAME.git

you can just type:

% git-clone-from-github NAME

The utility will try the users specified in config file, as well as prefixes and clone the first repo that exists. You can put something like this in githubutils.conf:

[prog=git-clone-from-github]
users = ["perlancar", "perlancar2"]
prefixes = ["perl5-", "perl-"]
suffixes = ["-p5"]

The utility will check whether repo in these URLs exist:

git@github.com:perlancar/perl5-NAME.git
git@github.com:perlancar/perl-NAME.git
git@github.com:perlancar/NAME-p5.git
git@github.com:perlancar2/perl5-NAME.git
git@github.com:perlancar2/perl-NAME.git
git@github.com:perlancar2/NAME-p5.git

This function is not exported.

Arguments ('*' denotes required arguments):

  • name* => str

  • prefixes => array[str]

  • suffixes => array[str]

  • users => array[str]

    If not specified, will use login from github-cmd.conf file.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-GitHubUtils.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-GitHubUtils.

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/perlancar/perl-App-GitHubUtils/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

github-cmd from App::github::cmd

Net::GitHub

Pithub

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021, 2020, 2019, 2018 by perlancar@cpan.org.

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