Copy::From::Git - A small class to pull files from remote git repos into your current space
use Copy::From::Git; Copy::From::Git->new( repo => 'zabbix', files => { 'agent-probes/.*?\.py$' => 'usr/bin/', }, )->run;
Only two methods are to be used by this class, the new and run methods. The new method accepts a number of named parameters to override the defaults provided within the constructor.
Within the constructor, the hash reference is initialized as follows:
my $args = { server => 'guthub.com', path => '/petermblair/', repo => undef, branch => 'master', subdir => '.', user => getlogin(), @_, };
The parameters of note:
The server from which we will pull from.
The path preceding the name of the repository on the server.
The name of the git repository
An optional branch name to pull
deprecated
This is inferred from the getlogin() function. As this module will likely be called within a sudo reference, we want to execute any git over ssh calls as our login username.
This is a HASHREF in the format of regex-location => target path. Meaning:
files => { 'agent-probes/.*?\.py$' => 'usr/bin/', },
will look for all files that match the filename within the regex and place said file into the usr/bin location relative to your current directory.
pblair@tucows.com
To install Copy::From::Git, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Copy::From::Git
CPAN shell
perl -MCPAN -e shell install Copy::From::Git
For more information on module installation, please visit the detailed CPAN module installation guide.